/* ============================================
   NPIO - National Phenomenon Investigation Organization
   Official Archive Site Stylesheet
   Last Modified: 2019-03-15
   ============================================ */

:root {
  --bg-primary: #f5f5f0;
  --bg-secondary: #e8e8e0;
  --bg-header: #1a3a5c;
  --bg-header-dark: #0f2440;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #888;
  --text-header: #f0f0e8;
  --border-color: #c0c0b8;
  --border-dark: #888;
  --accent: #1a3a5c;
  --accent-light: #2a5a8c;
  --link-color: #1a5a9c;
  --link-hover: #0a3a6c;
  --danger: #8b0000;
  --warning: #8b6914;
  --success: #2e6b2e;
  --deleted: #b22222;
  --recoverable: #b8860b;
  --locked: #ddd;
  --font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-mono: "Courier New", "MS Gothic", monospace;
  --font-serif: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  font-size: 14px;
  min-height: 100vh;
}

/* === HEADER === */
.site-header {
  background: linear-gradient(180deg, var(--bg-header) 0%, var(--bg-header-dark) 100%);
  color: var(--text-header);
  padding: 0;
  border-bottom: 3px solid #c8a84e;
}

.header-top {
  display: flex;
  align-items: center;
  padding: 12px 40px;
  gap: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.header-emblem {
  width: 48px;
  height: 48px;
  border: 2px solid #c8a84e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  color: #c8a84e;
  flex-shrink: 0;
}

.header-title-area {
  flex: 1;
}

.header-title-area h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.15em;
  margin-bottom: 2px;
}

.header-title-area .header-subtitle {
  font-size: 11px;
  color: rgba(240, 240, 232, 0.7);
  letter-spacing: 0.08em;
}

/* === NAVIGATION === */
.site-nav {
  background: var(--bg-header-dark);
  padding: 0 40px;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 0;
}

.site-nav li a {
  display: block;
  padding: 10px 20px;
  color: rgba(240, 240, 232, 0.8);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.05em;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.site-nav li a:hover,
.site-nav li a.active {
  color: #fff;
  background: rgba(255,255,255,0.05);
  border-bottom-color: #c8a84e;
}

/* === MAIN CONTENT === */
.main-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 30px 40px;
}

.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb a {
  color: var(--link-color);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.page-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  letter-spacing: 0.05em;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  margin: 30px 0 15px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}

.content-box {
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 25px 30px;
  margin-bottom: 20px;
}

.content-box p {
  margin-bottom: 12px;
}

/* === TABLES === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  font-size: 13px;
}

.data-table th {
  background: var(--bg-header);
  color: var(--text-header);
  padding: 10px 15px;
  text-align: left;
  font-weight: 500;
  letter-spacing: 0.05em;
  border: 1px solid var(--bg-header-dark);
}

.data-table td {
  padding: 8px 15px;
  border: 1px solid var(--border-color);
  background: #fff;
}

.data-table tr:nth-child(even) td {
  background: var(--bg-secondary);
}

.data-table tr:hover td {
  background: #e8e8d8;
}

/* === STATUS BADGES === */
.status-public {
  color: var(--success);
  font-weight: 600;
}

.status-deleted {
  color: var(--deleted);
  font-weight: 600;
}

.status-recoverable {
  color: var(--recoverable);
  font-weight: 600;
  cursor: pointer;
}

.status-locked {
  color: var(--locked);
  font-weight: 600;
  animation: blink 1.5s infinite;
}

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

.status-classified {
  color: var(--text-muted);
  font-style: italic;
}

/* === REDACTED TEXT === */
.redacted {
  background: #1a1a1a;
  color: #1a1a1a;
  padding: 0 4px;
  user-select: none;
  cursor: default;
}

.redacted-css {
  background: #1a1a1a;
  color: #1a1a1a;
  padding: 0 4px;
  /* Viewable in DevTools */
}

/* === LINKS === */
a {
  color: var(--link-color);
  text-decoration: underline;
}

a:hover {
  color: var(--link-hover);
}

/* === FOOTER === */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 20px 40px;
  margin-top: 60px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.site-footer p {
  margin-bottom: 4px;
}

.footer-note {
  font-size: 10px;
  color: #aaa;
}

/* === NOTICE BOX === */
.notice {
  background: #fffbe6;
  border: 1px solid #e6d85e;
  border-left: 4px solid #c8a84e;
  padding: 15px 20px;
  margin: 20px 0;
  font-size: 13px;
}

.notice-danger {
  background: #fff0f0;
  border-color: #e8a0a0;
  border-left-color: var(--danger);
}

.notice-info {
  background: #f0f4ff;
  border-color: #a0b8e0;
  border-left-color: var(--accent-light);
}

/* === DOCUMENT STYLE === */
.document {
  font-family: var(--font-serif);
  line-height: 2;
}

.document-header {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 20px 25px;
  margin-bottom: 25px;
}

.document-header .doc-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.document-header .doc-title {
  font-size: 18px;
  font-weight: 600;
  margin: 8px 0;
}

.document-header .doc-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* === CARD GRID (Staff) === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.staff-card {
  background: #fff;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.staff-card-photo {
  height: 200px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.staff-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.3) contrast(1.1);
}

.staff-card-photo .silhouette {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #666 0%, #444 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.staff-card-photo .silhouette::after {
  content: "";
  width: 80px;
  height: 100px;
  background: #555;
  border-radius: 50% 50% 0 0;
}

.staff-card-body {
  padding: 15px 20px;
}

.staff-card-body h3 {
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 4px;
}

.staff-card-body .staff-role {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.staff-card-body .staff-bio {
  font-size: 13px;
  line-height: 1.7;
}

/* === HANDWRITTEN STYLE === */
.handwritten {
  font-family: "Klee One", "Zen Kurenaido", cursive, var(--font-body);
  background: #fffff8;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 31px,
    #e8e8e0 31px,
    #e8e8e0 32px
  );
  padding: 20px 30px;
  line-height: 32px;
  border: 1px solid #d0d0c0;
}

.handwritten .date-entry {
  color: var(--accent);
  font-weight: 600;
  margin-top: 16px;
}

/* === TERMINAL STYLE === */
.terminal {
  background: #0a0a0a;
  color: #00ff41;
  font-family: var(--font-mono);
  padding: 25px 30px;
  border: 1px solid #333;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal .prompt {
  color: #00cc33;
}

.terminal .system {
  color: #888;
}

.terminal .warning {
  color: #ffaa00;
}

.terminal .error {
  color: #ff4444;
}

.terminal .highlight {
  color: #00ffff;
}

/* === INFO GRID === */
.info-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 15px;
  font-size: 13px;
}

.info-grid dt {
  color: var(--text-muted);
  font-weight: 500;
}

.info-grid dd {
  color: var(--text-primary);
}

/* === CLASSIFICATION BANNER === */
.classified-banner {
  background: var(--danger);
  color: #fff;
  text-align: center;
  padding: 8px;
  font-size: 12px;
  letter-spacing: 0.2em;
  font-weight: 600;
}

/* === HIDDEN ELEMENTS === */
.hidden-text {
  color: var(--bg-primary);
  font-size: 10px;
  user-select: text;
}

.micro-text {
  font-size: 4px;
  color: var(--text-muted);
  line-height: 1;
}

/* === TOOLTIP === */
.has-tooltip {
  position: relative;
  border-bottom: 1px dotted var(--text-muted);
  cursor: help;
}

.has-tooltip .tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 100;
  transition: opacity 0.3s;
  font-family: var(--font-body);
}

.has-tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* === CHAT WINDOW === */
.chat-window {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 320px;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 1000;
  font-size: 13px;
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.chat-header {
  background: #2a2a2a;
  color: #ccc;
  padding: 10px 15px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}

.chat-body {
  padding: 15px;
  max-height: 200px;
  overflow-y: auto;
  color: #ccc;
  line-height: 1.6;
}

.chat-body .msg {
  margin-bottom: 8px;
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.chat-input {
  border-top: 1px solid #333;
  padding: 10px 15px;
  display: flex;
  gap: 8px;
}

.chat-input input {
  flex: 1;
  background: #2a2a2a;
  border: 1px solid #444;
  color: #ccc;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 4px;
  outline: none;
}

.chat-input button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
}

/* === EMAIL THREAD === */
.email-thread {
  background: #fff;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.email-header {
  background: var(--bg-secondary);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

.email-header .email-from {
  font-weight: 600;
}

.email-header .email-date {
  float: right;
  color: var(--text-muted);
  font-size: 12px;
}

.email-header .email-subject {
  color: var(--text-secondary);
  margin-top: 4px;
}

.email-body {
  padding: 15px 20px;
  font-size: 14px;
  line-height: 1.8;
}

.email-reply {
  border-top: 1px solid var(--border-color);
  padding: 12px 20px;
  background: #f8f8f4;
  font-size: 13px;
}

.email-reply .reply-label {
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 6px;
}

/* === PROGRESS BAR === */
.progress-container {
  width: 100%;
  max-width: 500px;
  margin: 30px auto;
}

.progress-bar {
  width: 100%;
  height: 24px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ff41, #00cc33);
  width: 0%;
  transition: width 0.3s;
  border-radius: 3px;
}

.progress-text {
  text-align: center;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: #00ff41;
}

/* === WARNING BANNER === */
.warning-banner {
  background: #330000;
  color: #ff4444;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  letter-spacing: 0.1em;
  animation: warningPulse 2s infinite;
}

@keyframes warningPulse {
  0%, 100% { background: #330000; }
  50% { background: #440000; }
}

/* === TIMELINE === */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 25px;
  padding-left: 25px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
}

.timeline-item.highlight::before {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(139, 0, 0, 0.5);
}

.timeline-item.current::before {
  background: #00ff41;
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(0, 255, 65, 0.3); }
  50% { box-shadow: 0 0 12px rgba(0, 255, 65, 0.8); }
}

.timeline-date {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.timeline-content {
  font-size: 14px;
  margin-top: 4px;
}

/* === DASHBOARD === */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}

.dashboard-card {
  background: #111;
  border: 1px solid #333;
  padding: 20px;
  color: #ccc;
}

.dashboard-card h3 {
  color: #00ff41;
  font-size: 13px;
  font-family: var(--font-mono);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #333;
}

/* === CHOICE BUTTONS === */
.choice-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 500px;
  margin: 40px auto;
}

.choice-btn {
  background: transparent;
  border: 1px solid #444;
  color: #ccc;
  padding: 20px 30px;
  font-size: 16px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.choice-btn:hover {
  background: rgba(255,255,255,0.05);
  border-color: #888;
  color: #fff;
}

/* === ENDING === */
.ending-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.ending-title {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0.2em;
  margin-bottom: 30px;
}

.ending-text {
  max-width: 600px;
  line-height: 2;
  font-size: 15px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .header-top { padding: 10px 20px; }
  .site-nav { padding: 0 20px; }
  .main-content { padding: 20px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
}
