/* ═══════════════════════════════════════════════════════════════════════════
   theObscuriverse — Base Theme
   Evolving aesthetic: 1800s frontier meets temporal drift
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Core palette */
  --bg:          #0a0806;
  --bg-surface:  #110e0a;
  --paper:       #f0e6cc;
  --paper-dark:  #d4c8a8;
  --ink:         #e8dcc8;
  --ink-dim:     #8a7d6a;
  --ink-muted:   #4a4035;
  --accent:      #c8882a;
  --accent-glow: rgba(200, 136, 42, 0.25);
  --accent-dim:  #7a5218;
  --danger:      #a83030;
  --rule:        #2a231a;
  --rule-light:  #3d3228;

  /* Typography */
  --serif-stack:      Georgia, 'Times New Roman', serif;
  --display-stack:    'Palatino Linotype', Palatino, 'Book Antiqua', serif;
  --mono-stack:       'Courier New', Courier, monospace;

  /* Spacing */
  --max-width: 1100px;
  --gap: 1.5rem;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif-stack);
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img, video { max-width: 100%; display: block; }

h1, h2, h3, h4, h5 {
  font-family: var(--display-stack);
  line-height: 1.2;
  color: var(--paper);
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.text-center { text-align: center; }
.text-dim { color: var(--ink-dim); }
.text-accent { color: var(--accent); }

/* ── Site header ───────────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 2rem;
  background: rgba(10, 8, 6, 0.88);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}

.site-header .logo {
  font-family: var(--display-stack);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--paper);
  letter-spacing: .04em;
}

.site-header .logo span { color: var(--accent); }

.header-nav { display: flex; align-items: center; gap: 1.5rem; }

.header-nav a {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-dim);
  transition: color .2s;
}

.header-nav a:hover { color: var(--ink); text-decoration: none; }

.btn {
  display: inline-block;
  padding: .45rem 1.1rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  border: 1px solid currentColor;
  cursor: pointer;
  transition: background .2s, color .2s;
  font-family: var(--mono-stack);
  background: transparent;
}

.btn-primary {
  color: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
}

.btn-ghost {
  color: var(--ink-dim);
  border-color: var(--rule-light);
}
.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--ink-dim);
  text-decoration: none;
}

/* ── Hero section ──────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(200,136,42,.07) 0%, transparent 70%),
    radial-gradient(ellipse 100% 100% at 50% 50%, #0f0b07 0%, #0a0806 100%);
  z-index: 0;
}

/* Grain texture overlay */
.hero-bg::after {
  content: '';
  position: absolute;
  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='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  opacity: .4;
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; max-width: 760px; }

.hero-eyebrow {
  font-family: var(--mono-stack);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .25em;
  color: var(--accent);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
}

.hero-eyebrow::before,
.hero-eyebrow::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--accent-dim);
}

.hero-title {
  font-family: var(--display-stack);
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-style: italic;
  font-weight: 400;
  color: var(--paper);
  line-height: 1.05;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 80px rgba(200,136,42,.2);
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
}

.hero-tagline {
  font-size: 1rem;
  color: var(--ink-dim);
  font-style: italic;
  max-width: 520px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

/* Era clock */
.era-display {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  border: 1px solid var(--rule-light);
  padding: .75rem 2rem;
  margin-top: 1rem;
  position: relative;
}

.era-display::before {
  content: 'CURRENT ERA';
  position: absolute;
  top: -.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  padding: 0 .5rem;
  font-family: var(--mono-stack);
  font-size: .6rem;
  letter-spacing: .2em;
  color: var(--ink-muted);
}

.era-year {
  font-family: var(--mono-stack);
  font-size: 2.4rem;
  color: var(--accent);
  letter-spacing: .1em;
  line-height: 1;
}

.era-sub {
  font-family: var(--mono-stack);
  font-size: .6rem;
  letter-spacing: .15em;
  color: var(--ink-muted);
}

/* ── Content sections ──────────────────────────────────────────────────────── */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-rule {
  border: none;
  border-top: 1px solid var(--rule);
}

.section-label {
  font-family: var(--mono-stack);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: 1rem;
}

.section-body {
  color: var(--ink-dim);
  max-width: 60ch;
  line-height: 1.8;
}

/* Feature cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.feature-card {
  border: 1px solid var(--rule);
  padding: 1.75rem;
  background: var(--bg-surface);
  position: relative;
  transition: border-color .2s;
}

.feature-card:hover { border-color: var(--accent-dim); }

.feature-card-icon {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.feature-card h3 {
  font-size: 1.05rem;
  margin-bottom: .5rem;
  font-style: italic;
}

.feature-card p {
  font-size: .88rem;
  color: var(--ink-dim);
  line-height: 1.6;
}

/* Timeline strip */
.timeline {
  display: flex;
  gap: 0;
  margin-top: 3rem;
  border: 1px solid var(--rule);
  overflow: hidden;
}

.timeline-era {
  flex: 1;
  padding: 1.25rem 1rem;
  border-right: 1px solid var(--rule);
  text-align: center;
  transition: background .2s;
}
.timeline-era:last-child { border-right: none; }
.timeline-era:hover { background: var(--bg-surface); }

.timeline-era .era-badge {
  font-family: var(--mono-stack);
  font-size: .65rem;
  letter-spacing: .15em;
  color: var(--accent);
  margin-bottom: .4rem;
}

.timeline-era h4 {
  font-size: .9rem;
  font-style: italic;
  margin-bottom: .3rem;
}

.timeline-era p {
  font-size: .75rem;
  color: var(--ink-muted);
}

/* Progress bar */
.era-progress-bar {
  margin-top: 2rem;
  border: 1px solid var(--rule);
  height: 6px;
  background: var(--bg-surface);
  position: relative;
  overflow: hidden;
}

.era-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width 1s ease;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ── Site footer ───────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem;
  text-align: center;
  font-family: var(--mono-stack);
  font-size: .65rem;
  letter-spacing: .1em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

/* ── Auth pages ────────────────────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse 50% 60% at 50% 0%, rgba(200,136,42,.05) 0%, transparent 70%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--rule-light);
  background: var(--bg-surface);
  padding: 2.5rem 2rem;
}

.auth-logo {
  font-family: var(--display-stack);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--paper);
  text-align: center;
  margin-bottom: .25rem;
}

.auth-logo span { color: var(--accent); }

.auth-subtitle {
  font-family: var(--mono-stack);
  font-size: .65rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: center;
  margin-bottom: 2rem;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.75rem;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--mono-stack);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: .5rem;
  color: var(--ink-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}

.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.auth-form { display: none; flex-direction: column; gap: .9rem; }
.auth-form.visible { display: flex; }

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-family: var(--mono-stack);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-dim);
}

.auth-form input {
  padding: .55rem .7rem;
  border: 1px solid var(--rule-light);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif-stack);
  font-size: .95rem;
  outline: none;
  transition: border-color .15s;
}

.auth-form input:focus { border-color: var(--accent); }

.auth-form .btn { width: 100%; justify-content: center; margin-top: .5rem; padding: .65rem; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--ink-muted);
  font-family: var(--mono-stack);
  font-size: .6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .6rem;
  border: 1px solid var(--rule-light);
  background: transparent;
  color: var(--ink-dim);
  font-family: var(--mono-stack);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  text-decoration: none;
}

.google-btn:hover { border-color: var(--accent-dim); color: var(--ink); text-decoration: none; }

.auth-error {
  font-family: var(--mono-stack);
  font-size: .72rem;
  color: var(--danger);
  background: rgba(168,48,48,.1);
  border: 1px solid rgba(168,48,48,.3);
  padding: .5rem .75rem;
  display: none;
}

.auth-error.visible { display: block; }

.auth-switch {
  text-align: center;
  font-size: .8rem;
  color: var(--ink-muted);
  margin-top: 1.25rem;
  font-style: italic;
}

.auth-switch a { color: var(--accent); }

/* ── Profile / Admin pages ─────────────────────────────────────────────────── */
.page-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
}

.page-header {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.5rem;
  margin-bottom: 2.5rem;
}

.page-title { font-size: 1.8rem; font-style: italic; }

.card {
  border: 1px solid var(--rule);
  background: var(--bg-surface);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-title {
  font-family: var(--mono-stack);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--ink-muted);
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--rule);
}

/* Admin table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

.data-table th, .data-table td {
  text-align: left;
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--rule);
}

.data-table th {
  font-family: var(--mono-stack);
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-muted);
}

.data-table td { color: var(--ink-dim); }

.badge {
  display: inline-block;
  padding: .1rem .45rem;
  font-family: var(--mono-stack);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  border: 1px solid;
}

.badge-admin  { color: var(--accent);  border-color: var(--accent-dim); }
.badge-user   { color: var(--ink-muted); border-color: var(--rule); }
.badge-active { color: #5a9a5a; border-color: #2a5a2a; }
.badge-off    { color: var(--danger);  border-color: rgba(168,48,48,.4); }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .site-header { padding: .6rem 1rem; }
  .header-nav a { font-size: .75rem; letter-spacing: .05em; }
  .hero-cta { flex-direction: column; align-items: center; }
  .timeline { flex-direction: column; }
  .timeline-era { border-right: none; border-bottom: 1px solid var(--rule); }
  .timeline-era:last-child { border-bottom: none; }
  .page-wrap { padding-top: 4rem; }
}
