:root {
  --bg:        #0e0d0b;
  --bg2:       #161410;
  --bg3:       #1e1b16;
  --bg4:       #252118;
  --gold:      #c9a84c;
  --gold-l:    #dfc070;
  --gold-d:    #7a6428;
  --gold-dim:  rgba(201,168,76,0.12);
  --red:       #b84040;
  --red-dim:   rgba(184,64,64,0.12);
  --text:      #e0d8c8;
  --text-mid:  #a09880;
  --text-dim:  #6a6050;
  --border:    #2a2620;
  --border-l:  #3a3528;
  --success:   #5a9e6a;
  --r:         8px;
  --r-sm:      4px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Georgia', 'Times New Roman', serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-l); text-decoration: underline; }

/* ── Noise texture overlay ────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* ── Header ───────────────────────────────────────────── */
header {
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}

.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.site-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
}

.site-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: sans-serif;
  letter-spacing: 0.04em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-family: sans-serif;
  font-size: 0.8rem;
}

.header-nav a {
  color: var(--text-mid);
}

.header-nav a:hover { color: var(--gold); text-decoration: none; }

.nav-perfil {
  border: 1px solid var(--gold-d);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  color: var(--gold) !important;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  background: var(--gold-dim);
}

.nav-perfil:hover {
  background: rgba(201,168,76,0.2);
  color: var(--gold-l) !important;
  text-decoration: none;
}

.nav-admin {
  border: 1px solid var(--border-l);
  padding: 0.3rem 0.7rem;
  border-radius: var(--r-sm);
  color: var(--text-dim) !important;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.nav-admin:hover {
  border-color: var(--gold-d);
  color: var(--gold-d) !important;
}

/* ── Layout wrapper ───────────────────────────────────── */
.page {
  flex: 1;
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

/* ── Index hero ───────────────────────────────────────── */
.index-hero {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.index-hero h2 {
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.index-hero p {
  font-size: 0.9rem;
  color: var(--text-mid);
  font-family: sans-serif;
  max-width: 560px;
  line-height: 1.7;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1rem;
  font-family: sans-serif;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.hero-meta span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ── Section label ────────────────────────────────────── */
.section-label {
  font-family: sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-d);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Philosopher cards ────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 3rem;
}

.card {
  background: var(--bg2);
  padding: 1.5rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-decoration: none !important;
}

.card:hover { background: var(--bg3); }

.card-glyph {
  font-size: 2rem;
  color: var(--gold-d);
  margin-bottom: 0.5rem;
  font-family: 'Georgia', serif;
  line-height: 1;
}

.card-name {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 600;
}

.card-school {
  font-size: 0.75rem;
  color: var(--gold);
  font-family: sans-serif;
}

.card-era {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: sans-serif;
}

.card-id {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  font-family: 'Courier New', monospace;
  font-size: 0.65rem;
  color: var(--border-l);
}

.card-arrow {
  position: absolute;
  bottom: 0.9rem;
  right: 0.9rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  transition: color 0.15s, transform 0.15s;
}

.card:hover .card-arrow {
  color: var(--gold);
  transform: translateX(2px);
}


/* ── Profile page layout ──────────────────────────────── */
.breadcrumb {
  font-family: sans-serif;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--gold); text-decoration: none; }
.breadcrumb .sep { color: var(--border-l); }
.breadcrumb .current { color: var(--text-mid); }

.profile-url-bar {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--text-mid);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.45rem 0.8rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.url-method {
  background: rgba(201,168,76,0.15);
  color: var(--gold);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  letter-spacing: 0.05em;
}

.url-path { color: var(--text); }
.url-param { color: var(--gold); }

.profile-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* Sidebar */
.profile-sidebar {
  position: sticky;
  top: 1.5rem;
}

.profile-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.profile-card-head {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 1.25rem;
  text-align: center;
}

.profile-glyph {
  font-size: 3rem;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.5rem;
  font-family: 'Georgia', serif;
}

.profile-glyph.admin { color: var(--red); }

.profile-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.profile-card-cat {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: sans-serif;
  margin-top: 0.2rem;
}

.profile-fields {
  padding: 0;
}

.profile-field {
  display: flex;
  flex-direction: column;
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-family: sans-serif;
}

.profile-field:last-child { border-bottom: none; }

.field-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.15rem;
}

.field-value {
  font-size: 0.82rem;
  color: var(--text-mid);
}

/* Main content */
.profile-content h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
  line-height: 1.2;
}

.profile-subtitle {
  font-size: 0.85rem;
  color: var(--text-mid);
  font-family: sans-serif;
  margin-bottom: 1.75rem;
}

.profile-quote {
  border-left: 3px solid var(--gold-d);
  padding: 0.75rem 1.25rem;
  margin-bottom: 2rem;
  font-style: italic;
  color: var(--text-mid);
  font-size: 1.05rem;
  background: var(--bg2);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.profile-bio {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 2rem;
  font-family: 'Georgia', serif;
}

.profile-bio p + p { margin-top: 1em; }

.works-section h3 {
  font-size: 0.75rem;
  font-family: sans-serif;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-d);
  margin-bottom: 0.75rem;
}

.works-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.works-list li {
  font-family: sans-serif;
  font-size: 0.78rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  border-radius: var(--r-sm);
  color: var(--text-mid);
}

/* ── Admin profile ────────────────────────────────────── */
.admin-banner {
  background: var(--red-dim);
  border: 1px solid rgba(184,64,64,0.4);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  font-family: sans-serif;
}

.admin-banner-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e07070;
  margin-bottom: 0.3rem;
}

.admin-banner-body {
  font-size: 0.83rem;
  color: #c06060;
  line-height: 1.5;
}

.flag-reveal {
  background: var(--bg3);
  border: 1px solid var(--gold-d);
  border-radius: var(--r);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.flag-reveal-label {
  font-family: sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-d);
  margin-bottom: 0.4rem;
}

.flag-reveal-value {
  font-family: 'Courier New', monospace;
  font-size: 1.05rem;
  color: var(--gold-l);
  word-break: break-all;
}

.admin-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  font-family: sans-serif;
  font-size: 0.8rem;
  margin-bottom: 1.5rem;
}

.data-cell {
  background: var(--bg2);
  padding: 0.7rem 1rem;
}

.data-cell-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.data-cell-value {
  font-family: 'Courier New', monospace;
  color: var(--text-mid);
  word-break: break-all;
}

/* ── Error page ───────────────────────────────────────── */
.error-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.error-code {
  font-size: 5rem;
  font-weight: 700;
  color: var(--border-l);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.error-msg {
  font-family: sans-serif;
  font-size: 0.95rem;
  color: var(--text-mid);
  margin-bottom: 1.5rem;
}

.error-back {
  font-family: sans-serif;
  font-size: 0.82rem;
}

/* ── Footer ───────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1rem 2rem;
  font-family: sans-serif;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-align: center;
  background: var(--bg2);
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 720px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-sidebar { position: static; }
  .cards { grid-template-columns: 1fr 1fr; }
  .header-inner { padding: 0 1rem; }
  .page { padding: 1.5rem 1rem; }
}

@media (max-width: 440px) {
  .cards { grid-template-columns: 1fr; }
  .admin-data-grid { grid-template-columns: 1fr; }
}
