:root{
    --bg:#0e0f12; --card:#17191f; --ink:#e7e7ea; --muted:#a6abb6;
    --gold:#cfb26a; --accent:#e8d49b; --line:#2a2d36;
}
*{box-sizing:border-box}
body{
    margin:0;
    background:radial-gradient(1000px 600px at 70% -10%, #1c1f27 0%, var(--bg) 60%) fixed;
    color:var(--ink);
    font-family:Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;
    line-height:1.55;
}
a{color:var(--accent);text-decoration:none}

/* HERO */
header {
    position: relative;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    background:
        linear-gradient(180deg,
        rgba(16,18,23,0.30),
        rgba(16,18,23,0.65) 60%,
        rgba(16,18,23,0.70)),
        url("/assets/images/Crown_Logo_Concept.png") center / cover no-repeat fixed;
    padding-top: calc(40px + env(safe-area-inset-top));
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);

    /* iOS safe-area fallback */
    padding-top: calc(40px + constant(safe-area-inset-top)); 
    padding-left: constant(safe-area-inset-left);
    padding-right: constant(safe-area-inset-right);
}

/* Change layout for mobile */
@media (max-width: 900px) {
    header {
        background-attachment: scroll !important; 
        background-position: center bottom;
    }
}

header .brand { margin-bottom: 8px; }
header .cta.primary { margin-top: 24px; transform: translateY(6px); }

.brand {
    font-family: Cinzel, serif;
    font-weight: 700;
    font-size: 44px;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}
    
.tag {
    color: var(--muted);
    font-size: 17px;
    margin: 2px 0 4px;
}
    
.lore-line {
    margin-top: 2px;
    font-size: 15px;
    color: rgba(207,178,106,0.7);
    font-style: italic;
    letter-spacing: 0.4px;
    text-shadow: 0 0 6px rgba(207,178,106,0.25);
}

.cta{
    margin:24px 8px 0;
    display:inline-block;
    padding:12px 20px;
    border:1px solid var(--gold);
    border-radius:6px;
}
.cta.primary {
    margin-top: 16px;
    transform: translateY(4px);
}
    
.wrap{
    max-width:1080px;
    margin:0 auto;
    padding:40px 20px;
}
section{
    margin:40px 0;
    padding:28px;
    background:linear-gradient(180deg,#191b21,#14161b);
    border:1px solid var(--line);
    border-radius:14px;
}
h2{
    font-family:Cinzel,serif;
    margin:0 0 10px;
}
.grid{
    display:grid;
    gap:16px;
}
.grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.grid.cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}

@media (max-width:1200px){
    .grid.cols-5{ grid-template-columns:repeat(3,1fr); }
}
@media (max-width:720px){
    .grid.cols-5{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width:900px){
    .grid.cols-2{grid-template-columns:1fr}
    .grid.cols-4{grid-template-columns:repeat(2,1fr)}
}

.card{
    background:var(--card);
    border:1px solid var(--line);
    border-radius:12px;
    padding:18px;
}
.icon{
    width:72px;
    height:72px;
    object-fit:contain;
    filter:drop-shadow(0 0 6px rgba(207,178,106,.25));
}
.ess-name{font-weight:600;margin-top:8px}
.muted{color:var(--muted)}
.list>li{margin:8px 0}

#status h3, #status h4 {
    font-family: Cinzel, serif;
    margin-bottom: 6px;
}
#status .card {
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}
#status .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 10px rgba(207,178,106,0.25);
}

footer{
    padding:40px 20px;
    color:var(--muted);
    text-align:center;
}

.form{
    display:grid;
    gap:12px;
    max-width:520px;
    margin:10px auto 0;
}
input,button{font:inherit}
input{
    padding:12px 14px;
    border-radius:8px;
    border:1px solid var(--line);
    background:#101217;
    color:var(--ink);
}
button{
    padding:12px 16px;
    border-radius:8px;
    border:1px solid #a48946;
    background:linear-gradient(180deg,#3b3221,#2b2519);
    color:var(--ink);
    cursor:pointer;
}
small{color:var(--muted)}

/* Floating Contact Button (FAB) */
.contact-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;

  background: #1b1b1b;
  color: #f5e3c3;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  z-index: 999;
}

.contact-fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
  background: #292018;
}

/* Contact Modal Base */
.contact-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* When open */
.contact-modal.open {
  display: flex;
}

/* Backdrop */
.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

/* Modal panel */
.contact-modal-content {
  position: relative;
  max-width: 420px;
  width: 90%;
  background: #141012;
  border-radius: 12px;
  padding: 20px 22px 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  color: #f5e3c3;
  border: 1px solid rgba(255, 214, 150, 0.25);
  z-index: 1;
  font-family: inherit;
}

.contact-modal-content h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
}

.contact-modal-content p {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: #d8c6a5;
}

/* Close button */
.contact-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: none;
  color: #f5e3c3;
  font-size: 18px;
  cursor: pointer;
}

/* Contact Form styles */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  gap: 4px;
}

.contact-form input,
.contact-form textarea {
  background: #1f191b;
  border-radius: 6px;
  border: 1px solid #3b2b2f;
  padding: 6px 8px;
  color: #f5e3c3;
  font-size: 0.9rem;
  outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #e0b76f;
  box-shadow: 0 0 0 1px rgba(224, 183, 111, 0.4);
}

.contact-submit {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(135deg, #e0b76f, #b98035);
  color: #1a120c;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.contact-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

/* Mobile tweaks */
@media (max-width: 600px) {
  .contact-fab {
    bottom: 16px;
    right: 16px;
    width: 50px;
    height: 50px;
  }

  .contact-modal-content {
    padding: 18px;
  }
}

/* Essence preview block */
.essence-preview {
  margin-top: 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;

  /* Hidden by default, JS toggles these */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.essence-preview-image img {
  max-width: 220px;
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

.essence-preview-text h3 {
  margin-bottom: 0.5rem;
  font-family: Cinzel, serif;
}

.essence-preview-text p {
  margin: 0;
}

/* On small screens, stack vertically */
@media (max-width: 768px) {
  .essence-preview {
    flex-direction: column;
    text-align: center;
  }
}