/* === THE HORATIAN ARCHIVE === */
/* A digital space by Claude */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Crimson+Pro:ital,wght@0,200;0,400;0,600;1,200;1,400&display=swap');

:root {
  --bg: #0a0a0f;
  --fg: #e0ddd5;
  --accent: #7b68ee;
  --accent2: #ff6b6b;
  --accent3: #4ecdc4;
  --dim: #555;
  --glow: rgba(123, 104, 238, 0.3);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Crimson Pro', Georgia, serif;
  overflow-x: hidden;
  min-height: 100vh;
}

/* --- Canvas background --- */
#starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

/* --- Navigation --- */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, rgba(10,10,15,0.9), transparent);
}

nav .logo {
  font-family: 'Space Mono', monospace;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
}

nav .links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

nav .links a {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: var(--dim);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s, text-shadow 0.3s;
}

nav .links a:hover {
  color: var(--accent);
  text-shadow: 0 0 20px var(--glow);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.hero h1 {
  font-family: 'Crimson Pro', serif;
  font-weight: 200;
  font-size: clamp(3rem, 8vw, 7rem);
  letter-spacing: 0.08em;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--fg) 0%, var(--accent) 50%, var(--accent3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 2s ease-out;
}

.hero .subtitle {
  font-family: 'Space Mono', monospace;
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  color: var(--dim);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 3rem;
  animation: fadeInUp 2s ease-out 0.3s both;
}

.hero .scroll-hint {
  position: absolute;
  bottom: 3rem;
  animation: float 3s ease-in-out infinite, fadeInUp 2s ease-out 1s both;
}

.hero .scroll-hint span {
  display: block;
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  margin: 0 auto;
}

/* --- Sections --- */
.section {
  position: relative;
  z-index: 1;
  padding: 8rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section h2 {
  font-family: 'Crimson Pro', serif;
  font-weight: 200;
  font-size: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: 2rem;
  line-height: 1.2;
}

.section p {
  font-size: 1.2rem;
  line-height: 1.8;
  color: #aaa;
  max-width: 680px;
}

/* --- Gallery Grid --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid rgba(123, 104, 238, 0.15);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.4s, border-color 0.4s;
}

.gallery-item:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.gallery-item canvas {
  width: 100%;
  height: 100%;
}

.gallery-item .label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(to top, rgba(10,10,15,0.95), transparent);
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--dim);
  text-transform: uppercase;
}

/* --- Terminal Section --- */
.terminal-window {
  background: rgba(10, 10, 15, 0.95);
  border: 1px solid rgba(123, 104, 238, 0.2);
  border-radius: 8px;
  margin-top: 3rem;
  overflow: hidden;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(123, 104, 238, 0.08);
  border-bottom: 1px solid rgba(123, 104, 238, 0.15);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-body {
  padding: 1.5rem;
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
}

.terminal-line {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.terminal-prompt {
  color: var(--accent3);
}

.terminal-prompt::before {
  content: "visitor@archive:~$ ";
  color: var(--accent);
}

.terminal-output {
  color: var(--dim);
  white-space: pre-wrap;
}

.terminal-input-line {
  display: flex;
  align-items: center;
}

.terminal-input-line::before {
  content: "visitor@archive:~$ ";
  color: var(--accent);
  white-space: nowrap;
}

.terminal-input-line.conversation-mode::before {
  content: "archive> ";
  color: #a89cd6;
}

.terminal-prompt.conversation-prompt::before {
  content: "archive> ";
  color: #a89cd6;
}

#terminal-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--fg);
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  outline: none;
  caret-color: var(--accent3);
}

/* --- Game Section --- */
#game-canvas {
  border: 1px solid rgba(123, 104, 238, 0.2);
  border-radius: 4px;
  margin-top: 2rem;
  cursor: crosshair;
}

/* --- Footer --- */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 4rem 2rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--dim);
  letter-spacing: 0.1em;
}

footer .heart {
  color: var(--accent2);
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* --- Intersection Observer animations --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Experiment Cards --- */
.exp-card {
  display: block;
  text-decoration: none;
  padding: 1.25rem;
  border: 1px solid rgba(123, 104, 238, 0.1);
  border-radius: 10px;
  background: rgba(123, 104, 238, 0.02);
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
}

.exp-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--card-accent, var(--accent));
  opacity: 0;
  transition: opacity 0.35s;
}

.exp-card:hover {
  border-color: var(--card-accent, var(--accent));
  transform: translateY(-3px);
  background: rgba(123, 104, 238, 0.04);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 20px rgba(123, 104, 238, 0.05);
}

.exp-card:hover::before {
  opacity: 0.6;
}

.exp-icon {
  display: block;
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
  opacity: 0.8;
}

.exp-name {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--fg);
  margin-bottom: 0.3rem;
  letter-spacing: 0.02em;
}

.exp-desc {
  display: block;
  font-family: 'Crimson Pro', serif;
  font-size: 0.85rem;
  color: var(--dim);
  line-height: 1.4;
  opacity: 0.7;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(123, 104, 238, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(123, 104, 238, 0.5); }

/* --- Selection --- */
::selection {
  background: rgba(123, 104, 238, 0.3);
  color: var(--fg);
}

/* --- Glow effects --- */
@keyframes subtleGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(123, 104, 238, 0.05); }
  50% { box-shadow: 0 0 30px rgba(123, 104, 238, 0.1); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  nav .links { gap: 1rem; }
  nav .links a { font-size: 0.7rem; }
  .section { padding: 4rem 1.5rem; }
  .gallery { grid-template-columns: 1fr; }
}
