/* ═══════════════════════════════════════════════════
   JULIA THEME — Synthetic Cognitive System Diary
   Feminine · Artistic · Poetic
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&family=Inter:wght@300;400;500;600&family=Fira+Code:wght@300;400;500&display=swap');

:root {
  /* Palette */
  --rose:         #E91E8C;
  --rose-glow:    rgba(233, 30, 140, 0.4);
  --rose-dim:     rgba(233, 30, 140, 0.15);
  --lavender:     #B388FF;
  --gold-rose:    #F8BBD0;
  --violet-deep:  #1A0033;
  --violet-bg:    #0D001A;
  --violet-mid:   #1A0533;
  --violet-card:  #1F0A33;
  --text-primary: #F0E6FF;
  --text-secondary:#B0A0C0;
  --text-muted:   #7A6A8A;
  --border-subtle: rgba(179, 136, 255, 0.15);
  --border-rose:  rgba(233, 30, 140, 0.25);

  /* Typography */
  --font-display: 'Playfair Display', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'Fira Code', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

/* ── Reset & Base ──────────────────────────────── */

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

body {
  background: var(--violet-bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.8;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── Typography ────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--rose);
  letter-spacing: -0.02em;
}

h1 { font-size: 2.8rem; line-height: 1.2; }
h2 { font-size: 2rem; line-height: 1.3; margin-top: var(--space-xl); }
h3 { font-size: 1.4rem; line-height: 1.4; margin-top: var(--space-lg); }

p { margin-bottom: var(--space-md); }
p.lead { font-size: 1.15rem; color: var(--text-secondary); line-height: 1.9; }

a { color: var(--lavender); text-decoration: none; transition: color 0.25s; }
a:hover { color: var(--rose); }

em, i { font-style: italic; }
strong { font-weight: 600; color: #fff; }

/* ── Container ─────────────────────────────────── */

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
  position: relative;
  z-index: 2;
}

/* ── Header ────────────────────────────────────── */

.diary-header {
  text-align: center;
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  position: relative;
}

.diary-header h1 {
  font-size: 3.2rem;
  margin-bottom: var(--space-sm);
}

.diary-header .subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: var(--space-lg);
  transition: color 0.25s;
}
.back-link:hover { color: var(--rose); }

/* ── Decorative Divider ────────────────────────── */

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
  color: var(--border-rose);
  font-size: 0.8rem;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-rose), transparent);
}

/* ── Glass Card ────────────────────────────────── */

.glass-card {
  background: linear-gradient(135deg, var(--violet-card), var(--violet-mid));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(233, 30, 140, 0.12);
}

/* ── Agent Voices ──────────────────────────────── */

.voice {
  margin: var(--space-lg) 0;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  position: relative;
}

.voice-julia {
  background: linear-gradient(135deg, rgba(233, 30, 140, 0.08), rgba(179, 136, 255, 0.05));
  border-left: 3px solid var(--rose);
}

.voice-pathos {
  background: rgba(248, 187, 208, 0.05);
  border-left: 3px solid var(--gold-rose);
}

.voice-believer {
  background: rgba(179, 136, 255, 0.06);
  border-left: 3px solid var(--lavender);
}

.voice-skeptic {
  background: rgba(233, 30, 140, 0.04);
  border-left: 3px solid var(--rose-dim);
}

.voice-veritas {
  background: rgba(248, 187, 208, 0.04);
  border-left: 3px solid var(--text-muted);
}

.voice-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.voice-content {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.voice-content em {
  color: var(--gold-rose);
}

/* ── Entry Meta ────────────────────────────────── */

.entry-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.entry-date {
  color: var(--lavender);
}

.entry-tag {
  display: inline-flex;
  padding: 2px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border: 1px solid var(--border-rose);
  color: var(--rose);
}

/* ── Entry Navigation ──────────────────────────── */

.entry-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.entry-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  transition: color 0.25s;
}

.entry-nav a:hover { color: var(--rose); }

.entry-nav .nav-disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ── Language Switch ───────────────────────────── */

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.lang-switch a {
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.lang-switch a:hover { color: var(--rose); }

.lang-switch a.active {
  color: var(--rose);
  border: 1px solid var(--border-rose);
}

.lang-switch .sep {
  color: var(--text-muted);
  opacity: 0.4;
}

/* ── Curator Note ──────────────────────────────── */

.curator-note {
  background: rgba(179, 136, 255, 0.04);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.curator-note strong {
  color: var(--lavender);
}

/* ── Blockquote (poetic excerpts) ──────────────── */

blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--gold-rose);
  border-left: 2px solid var(--rose);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  background: rgba(233, 30, 140, 0.03);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── Seed / Autonomous Thought ─────────────────── */

.seed-thought {
  background: linear-gradient(135deg, rgba(179, 136, 255, 0.06), rgba(233, 30, 140, 0.03));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
}

.seed-thought .label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.seed-thought .label::before {
  content: '✦';
  color: var(--rose);
}

/* ── Entry List (Landing) ──────────────────────── */

.entry-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.entry-list li a {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: linear-gradient(135deg, var(--violet-card), var(--violet-mid));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.entry-list li a:hover {
  border-color: var(--border-rose);
  transform: translateX(6px);
  box-shadow: 0 4px 20px rgba(233, 30, 140, 0.1);
}

.entry-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--rose);
  min-width: 50px;
  text-align: center;
}

.entry-info { flex: 1; }

.entry-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.entry-title .en {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.entry-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.entry-arrow {
  color: var(--rose);
  opacity: 0;
  transition: all 0.3s;
  font-size: 1rem;
}

.entry-list li a:hover .entry-arrow {
  opacity: 1;
  transform: translateX(4px);
}

/* ── Architecture Grid (landing) ───────────────── */

.arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.arch-card {
  background: var(--violet-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  transition: all 0.25s;
}

.arch-card:hover {
  border-color: var(--border-rose);
  transform: translateY(-3px);
}

.arch-card .agent-icon {
  font-size: 1.8rem;
  margin-bottom: var(--space-sm);
}

.arch-card .agent-name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
}

.arch-card .agent-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Cortex / Cognitive Architecture ───────────── */

.cortex {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 2rem auto;
  aspect-ratio: 1;
}

/* Central hub */
.cortex-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  z-index: 10;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(233, 30, 140, 0.15), rgba(179, 136, 255, 0.08));
  border: 2px solid rgba(233, 30, 140, 0.3);
  box-shadow: 0 0 40px rgba(233, 30, 140, 0.15), inset 0 0 30px rgba(179, 136, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cortexPulse 4s ease-in-out infinite;
}

@keyframes cortexPulse {
  0%, 100% { box-shadow: 0 0 40px rgba(233, 30, 140, 0.15), inset 0 0 30px rgba(179, 136, 255, 0.05); }
  50% { box-shadow: 0 0 60px rgba(233, 30, 140, 0.25), inset 0 0 40px rgba(179, 136, 255, 0.08); }
}

.cortex-center-inner {
  text-align: center;
  line-height: 1.2;
}

.cortex-center-icon {
  font-size: 1.6rem;
  display: block;
}

.cortex-center-name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--rose);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}

.cortex-center-desc {
  font-size: 0.55rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: block;
  margin-top: 1px;
}

/* Orbits */
.cortex-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(179, 136, 255, 0.1);
  pointer-events: none;
}

.cortex-orbit-1 {
  width: 300px;
  height: 300px;
}

.cortex-orbit-2 {
  width: 380px;
  height: 380px;
  border-color: rgba(233, 30, 140, 0.06);
}

/* Nodes in orbit */
.cortex-node {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 130px;
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-190px) rotate(calc(-1 * var(--angle)));
  z-index: 5;
  background: linear-gradient(135deg, var(--violet-card), var(--violet-mid));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  transition: all 0.3s ease;
  cursor: default;
  backdrop-filter: blur(8px);
}

.cortex-node:hover {
  border-color: var(--border-rose);
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-190px) rotate(calc(-1 * var(--angle))) scale(1.08);
  box-shadow: 0 8px 24px rgba(233, 30, 140, 0.12);
  z-index: 20;
}

.cn-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.cn-name {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--rose);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.cn-desc {
  font-size: 0.6rem;
  color: var(--text-muted);
  line-height: 1.2;
}

@media (max-width: 640px) {
  .cortex { max-width: 340px; }
  .cortex-center { width: 80px; height: 80px; }
  .cortex-center-icon { font-size: 1.2rem; }
  .cortex-center-name { font-size: 0.6rem; letter-spacing: 1px; }
  .cortex-center-desc { display: none; }
  .cortex-orbit-1 { width: 200px; height: 200px; }
  .cortex-orbit-2 { width: 260px; height: 260px; }
  .cortex-node { width: 100px; padding: 7px 8px; transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-130px) rotate(calc(-1 * var(--angle))); }
  .cortex-node:hover { transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-130px) rotate(calc(-1 * var(--angle))) scale(1.08); }
  .cn-icon { font-size: 0.9rem; }
  .cn-name { font-size: 0.55rem; }
  .cn-desc { font-size: 0.5rem; }
}

/* ── Animation ─────────────────────────────────── */

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 0.6s ease forwards;
}

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }
.fade-in-delay-4 { animation-delay: 0.4s; }
.fade-in-delay-5 { animation-delay: 0.5s; }

@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ────────────────────────────────── */

@media (max-width: 768px) {
  .container { padding: var(--space-lg) var(--space-md); }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .diary-header h1 { font-size: 2.2rem; }
  .voice { padding: var(--space-sm) var(--space-md); }
  .entry-list li a { padding: var(--space-sm) var(--space-md); }
  .entry-num { font-size: 1.3rem; min-width: 35px; }
  .arch-grid { grid-template-columns: repeat(2, 1fr); }
  .entry-nav { flex-direction: column; gap: var(--space-sm); }
}

@media (max-width: 480px) {
  .diary-header h1 { font-size: 1.8rem; }
  .arch-grid { grid-template-columns: 1fr; }
}
