:root {
  --bg: #0d0d0f;
  --ink: #e7e6e3;
  --muted: #b2aba0;
  --accent: #ff4d2e;
  --ember: #ff9a3c;
  --ash: #7a7b80;
  --concrete: #61646b;
  --paper: rgba(255, 255, 255, 0.045);
  --paper-strong: rgba(255, 255, 255, 0.08);
  --shadow: rgba(0,0,0,0.55);
}

* { box-sizing: border-box }

html {
  height: 100%;
  scroll-padding-top: 80px;
  background: var(--bg);
}

body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex-grow: 1; }

.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  background: linear-gradient(180deg, rgba(13,13,15,0.9), rgba(13,13,15,0.7));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand { display: inline-flex; align-items: center; gap: 12px }
.brand-mark { font-size: 22px }
.brand-title { margin: 0; font-weight: 700; letter-spacing: 0.4px }
.brand-sub { margin: 0; color: var(--muted); font-size: 13px }
.site-nav { display: flex; gap: 10px; align-items: center }
.nav-btn, .nav-link {
  padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.08);
  background: var(--paper); color: var(--ink); text-decoration: none; cursor: pointer;
}
.nav-btn:hover, .nav-link:hover { background: var(--paper-strong) }

.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px;
  max-width: 1100px; margin: 40px auto; padding: 0 20px;
  overflow: hidden;
}
.hero-media { position: relative; display: grid; place-items: center; z-index: 1; }
.artifact {
  display: block; width: min(640px, 92%); height: auto;
  border-radius: 18px;
  box-shadow: 0 10px 40px var(--shadow);
  filter: contrast(1.02) saturate(1.06);
  position: relative;
  z-index: 1;
}

.flame, .glow {
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: 18px;
  z-index: 0;
}
.flame {
  background: conic-gradient(from 180deg at 50% 95%, rgba(255,77,46,0.25), transparent 40%, rgba(255,154,60,0.25), transparent 70%);
  mix-blend-mode: screen;
  animation: flicker 3.6s infinite ease-in-out;
}
.glow {
  box-shadow: 0 0 120px 25px rgba(255,77,46,0.15);
  animation: glow 4.8s infinite ease-in-out;
}
@keyframes flicker {
  0%, 100% { opacity: 0.35; transform: scale(1) translateY(0px) }
  50% { opacity: 0.6; transform: scale(1.02) translateY(-1px) }
}
@keyframes glow {
  0%, 100% { opacity: 0.25 }
  50% { opacity: 0.45 }
}

.hero-text { align-self: center; position: relative; z-index: 2; }
.section-title { margin: 0 0 10px; font-size: 28px; letter-spacing: 0.3px }
.section-desc { margin: 0 0 18px; color: var(--muted) }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1);
  background: var(--paper); color: var(--ink); cursor: pointer;
  position: relative; z-index: 2;
}
.btn.primary { background: linear-gradient(90deg, rgba(255,77,46,0.2), rgba(255,154,60,0.18)); border-color: rgba(255,154,60,0.35) }
.btn:hover { filter: brightness(1.06) }

.gallery { max-width: 1100px; margin: 20px auto 0; padding: 0 20px }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px }
.card { position: relative; border-radius: 16px; background: var(--paper); border: 1px solid rgba(255,255,255,0.08); cursor: pointer; overflow: hidden }
.card-media { margin: 0; padding: 12px }
.thumb {
  display: block; width: 100%; height: auto; border-radius: 12px;
  box-shadow: 0 10px 26px var(--shadow);
  transition: transform 0.25s ease, filter 0.25s ease, opacity 0.25s ease;
}
.caption { margin-top: 10px; color: var(--muted); font-size: 14px }

.fire-hover:hover { transform: scale(1.02) rotate(-0.4deg); filter: drop-shadow(0 0 18px rgba(255,77,46,0.35)) }
.ember-hover:hover { transform: scale(1.02); filter: drop-shadow(0 0 14px rgba(255,154,60,0.35)) }
.ash-hover:hover { transform: scale(1.01); filter: grayscale(0.6) brightness(0.92) }
.concrete-hover:hover { transform: translateY(-2px); filter: contrast(1.08) }

.lore { max-width: 860px; margin: 0 auto 0; padding: 0 20px 40px }
.lore-list { margin: 14px 0 0; padding-left: 18px }
.lore-list li { margin: 8px 0 }

.site-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px; border-top: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(0deg, rgba(13,13,15,0.9), rgba(13,13,15,0.7));
}
.foot-left { display: inline-flex; gap: 10px; align-items: center }
.foot-right { display: inline-flex; gap: 14px }

.modal {
  display: block;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: #121214;
  color: var(--ink);
  width: min(540px, 92%);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 280ms ease, transform 280ms ease;
}
.modal::backdrop {
  background: rgba(0,0,0,0.6);
  transition: opacity 280ms ease;
}
.modal[open].pre-open {
  opacity: 0;
  transform: scale(0.96);
}
.modal[open].active {
  opacity: 1;
  transform: scale(1);
}

.modal-title { margin: 0 0 10px }
.modal-desc { margin: 0 0 14px; color: var(--muted) }

.modal-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 26px var(--shadow);
  margin-bottom: 32px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: max-height 0s 320ms, opacity 320ms ease, transform 320ms ease;
}

.modal[open] .modal-img {
  max-height: 500px;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: max-height 0s 0s, opacity 320ms ease, transform 320ms ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-header,
.hero-text,
.hero-media,
.gallery,
.lore,
.site-footer,
.grid .card {
  opacity: 0; 
  animation: fadeInUp 0.7s ease-out forwards;
}

.site-header {
  animation-delay: 0.1s;
}

.hero-text {
  animation-delay: 0.3s;
}

.hero-media {
  animation-delay: 0.5s;
}

.gallery {
  animation-delay: 0.7s;
}

.grid .card:nth-child(1) { animation-delay: 0.8s; }
.grid .card:nth-child(2) { animation-delay: 0.9s; }
.grid .card:nth-child(3) { animation-delay: 1.0s; }
.grid .card:nth-child(4) { animation-delay: 1.1s; }

.lore {
  animation-delay: 1.0s;
}

.site-footer {
  animation-delay: 1.2s;
}
.wall {
  max-width: 600px;
  margin: 40px auto;
  background: #111;
  padding: 20px;
  border: 2px solid #444;
  font-family: monospace;
}
.wall input, .wall textarea {
  width: 100%;
  margin-bottom: 10px;
  background: #222;
  color: #eee;
  border: none;
  padding: 10px;
}
.wall button {
  background: #e00;
  color: #fff;
  border: none;
  padding: 10px;
  cursor: pointer;
}
#wall div {
  margin-top: 10px;
  padding: 5px;
  border-bottom: 1px dashed #555;
  animation: fadeInUp 0.5s ease forwards;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.wall-page {
  max-width: 720px;
  margin: 60px auto;
  padding: 0 20px;
  animation: fadeInUp 0.8s ease-out forwards;
}

.wall-page h1 {
  font-size: 28px;
  margin-bottom: 24px;
  color: var(--accent);
  text-align: center;
  animation: flicker 3.6s infinite ease-in-out;
}

.wall-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--paper);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px;
}

.wall-form input,
.wall-form textarea {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--concrete);
  border-radius: 10px;
  padding: 10px;
  font-family: inherit;
}

.wall-form button {
  align-self: flex-start;
  background: linear-gradient(90deg, var(--accent), var(--ember));
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: filter 0.3s ease;
}

.wall-form button:hover {
  filter: brightness(1.1);
}

.wall-feed {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wall-entry {
  background: var(--paper);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 12px 16px;
  animation: fadeInUp 0.5s ease forwards;
}

.wall-entry b {
  color: var(--ember);
}
.wall-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.wall-entry {
  background: var(--paper);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 12px 16px;
  animation: fadeInUp 0.5s ease forwards;
}

.wall-entry b {
  color: var(--ember);
}
.wall-form-zone input,
.wall-form-zone textarea {
  width: 100%;
  max-width: 600px;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #444;
  background-color: #111;
  color: #fff;
  font-family: inherit;
}

* {
  box-sizing: border-box;
}

.wall-page {
  max-width: 720px;
  margin: auto;
  padding: 20px;
}

.wall-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wall-form input,
.wall-form textarea {
  width: 100%;
  max-width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #444;
  background-color: #111;
  color: #fff;
  font-size: 1rem;
}
