/* ================================================================
   IMPHEIM.CSS
   ================================================================ */

/* ---- TOKENS ---- */
:root {
  /* Backgrounds */
  --bg:         #0f0a0b;   /* very dark, slight red-black undertone */
  --bg2:        #1a1214;   /* card/panel background */
  --bg3:        #251819;   /* hover overlay */
  --bg4:        #09060a;   /* deepest surface, inputs */

  /* Borders — warm gold-tinted instead of purple */
  --border:     rgba(201, 168, 76, 0.12);
  --border2:    rgba(201, 168, 76, 0.26);
  --border3:    rgba(201, 168, 76, 0.45);

  /* Text — warm white */
  --text:       #f5efee;
  --text2:      #c8b0aa;
  --muted:      #7a5d5a;

  /* Primary accent: GOLD */
  --gold:       #c9a84c;
  --gold-dim:   rgba(201, 168, 76, 0.14);
  --gold-bright:#f0c040;

  /* Royal Purple — for magical/special things (Impia RPG, special badges) */
  --purple:     #7c3aed;
  --purple-dim: rgba(124, 58, 237, 0.14);

  /* Imperial Red — for actions, events, emphasis */
  --red:        #c0222a;
  --red-dim:    rgba(192, 34, 42, 0.14);

  /* Chronicle entry type colours */
  --c-campaign:  #a78bfa;
  --c-event:     #ef4444;
  --c-lore:      #f0c040;
  --c-impia:     #e879f9;
  --c-art:       #f9a8d4;
  --c-milestone: #34d399;
  --c-stream:    #60a5fa;

  --font-d: 'Palatino Linotype', 'Palatino', Georgia, 'Times New Roman', serif;
  --font-b: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nav-h:  64px;
  --max-w:  1140px;
  --r-md:   12px;
  --r-lg:   18px;
  --r-pill: 9999px;
  --ease:   0.22s ease;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 1.125rem;   /* 18px base */
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--text); }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* Background image — set data-bg="path/to/img.jpg" on <body> */
body[data-bg]::before {
  content: '';
  position: fixed; inset: 0;
  background-image: var(--bg-img);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  opacity: var(--bg-opacity, 0.12);
  pointer-events: none;
  z-index: -1;
}

::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--bg4); }
::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, 0.22); border-radius: 4px; }

/* ---- TYPOGRAPHY ---- */
h1,h2,h3,h4 { font-family: var(--font-d); line-height: 1.2; color: var(--text); }
h1 { font-size: clamp(2rem,5vw,3.4rem); font-weight: 800; letter-spacing: .03em; }
h2 { font-size: clamp(1.45rem,3.5vw,2.3rem); font-weight: 600; }
h3 { font-size: clamp(1.1rem,2.5vw,1.55rem); font-weight: 600; }
p  { color: var(--text2); margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
}
.gradient-text {
  background: linear-gradient(135deg, #f0c040 0%, #c9a84c 40%, #dc2626 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gold-text {
  background: linear-gradient(135deg,#f0c040,#c9a84c 60%,#e8d090);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- LAYOUT ---- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container-narrow {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
section { padding: 5rem 0; }

.section-header { text-align: center; margin-bottom: 3rem; }
.section-header .eyebrow { margin-bottom: .9rem; }
.section-header p { font-size: 1.2rem; max-width: 660px; margin: .9rem auto 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
@media(max-width:900px){ .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media(max-width:600px){ .grid-2,.grid-3 { grid-template-columns: 1fr; } }

/* ---- NAV ---- */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(15,10,11,.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.site-nav > .nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.nav-brand {
  display: flex; align-items: center; gap: .6rem;
  text-decoration: none; flex-shrink: 0;
}
.nav-brand img {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  object-fit: cover;
}
.nav-brand-name {
  font-family: var(--font-d);
  font-size: 1rem; font-weight: 800;
  letter-spacing: .07em; color: var(--text);
}
.nav-links {
  display: flex; align-items: center; gap: .15rem;
  flex: 1;
}
.nav-links a {
  font-size: .9rem; font-weight: 600;
  color: var(--muted);
  padding: .4rem .85rem;
  border-radius: var(--r-pill);
  display: flex; align-items: center; gap: .3rem;
  transition: color var(--ease), background var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--border); }
.nav-links a.active { color: var(--gold); background: var(--gold-dim); }

.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute; top: calc(100% + .5rem); left: 0;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--r-md); padding: .5rem;
  min-width: 200px;
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a { display: block; border-radius: 6px; padding: .45rem .85rem; font-weight: 400; font-size: .9rem; white-space: nowrap; }
.nav-dropdown-menu a:hover { background: var(--bg3); }

.nav-social {
  display: flex; align-items: center; gap: .3rem;
  margin-left: auto;
}
.nav-social a {
  display: flex; align-items: center; justify-content: center;
  width: 33px; height: 33px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  color: var(--muted); font-size: .82rem;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}
.nav-social a:hover { color: var(--text); border-color: var(--border2); background: var(--bg3); }
.bsky-icon { width: .82em; height: .82em; vertical-align: middle; }
.footer-social .bsky-icon { width: 1em; height: 1em; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  padding: .5rem; cursor: pointer; margin-left: auto;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text2); border-radius: 2px; }

@media(max-width:768px){
  .nav-toggle { display: flex; }
  .nav-social { display: none; }
  .nav-links {
    display: none; position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    background: var(--bg2); border-bottom: 1px solid var(--border2);
    flex-direction: column; align-items: flex-start;
    padding: .75rem 1rem; gap: .1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.4);
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; padding: .65rem .85rem; }
  .nav-dropdown-menu { position: static; background: none; border: none; box-shadow: none; padding: 0 0 0 1rem; display: block; }
}

/* ---- FOOTER ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 5rem 0 2rem;
  margin-top: 8rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
@media(max-width:768px){ .footer-grid { grid-template-columns: 1fr; gap: 2rem; } }

.footer-name { font-family: var(--font-d); font-size: 1.25rem; font-weight: 800; margin-bottom: .7rem; }
.footer-desc { color: var(--muted); font-size: .9rem; line-height: 1.8; margin-bottom: 1.1rem; }
.footer-social { display: flex; gap: .4rem; flex-wrap: wrap; }
.footer-social a {
  display: flex; align-items: center; justify-content: center;
  width: 35px; height: 35px; border-radius: var(--r-pill);
  border: 1px solid var(--border); color: var(--muted); font-size: .88rem;
  transition: color var(--ease), border-color var(--ease);
}
.footer-social a:hover { color: var(--text); border-color: var(--border2); }

.footer-col-title {
  font-family: var(--font-d); font-size: .6rem;
  font-weight: 700; letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .9rem;
}
.footer-links { display: flex; flex-direction: column; gap: .45rem; }
.footer-links a { color: var(--text2); font-size: .9rem; }
.footer-links a:hover { color: var(--text); }

.footer-bottom {
  padding-top: 1.5rem; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem;
}
.footer-bottom p { font-size: .78rem; color: var(--muted); margin: 0; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.85rem; border-radius: var(--r-pill);
  font-size: .88rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  transition: transform var(--ease), box-shadow var(--ease), color var(--ease);
  text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, #b8860b, #c9a84c, #f0c040);
  color: #1a0f00; box-shadow: 0 0 28px rgba(201, 168, 76, 0.28);
}
.btn-primary:hover { color: #1a0f00; transform: translateY(-2px); box-shadow: 0 6px 36px rgba(201, 168, 76, 0.45); }
.btn-outline {
  background: transparent; border: 1.5px solid var(--border2); color: var(--text2);
}
.btn-outline:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }
.btn-gold {
  background: linear-gradient(135deg,#c9a84c,#f0c040); color: #1a1200; font-weight: 800;
}
.btn-gold:hover { color: #1a1200; transform: translateY(-2px); box-shadow: 0 6px 36px rgba(201,168,76,.4); }

/* ---- PAGE HERO ---- */
.page-hero {
  text-align: center;
  padding: 7rem 0 5rem;
  position: relative; overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; top: -100px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 550px;
  background: radial-gradient(ellipse at center top, rgba(201,168,76,.14) 0%, transparent 65%);
  pointer-events: none;
}
.page-hero .eyebrow { margin-bottom: 1rem; }
.page-hero h1 { margin-bottom: 1.2rem; }
.page-hero > .container > p { font-size: 1.2rem; max-width: 680px; margin: 0 auto 2rem; }
.hero-rule { width: 80px; height: 2px; background: linear-gradient(90deg,transparent,var(--gold),transparent); margin: 1.5rem auto 0; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }

/* ---- CARDS ---- */
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem;
  transition: border-color var(--ease), transform var(--ease);
}
.card:hover { border-color: var(--border2); transform: translateY(-3px); }

/* ---- GALLERY / LIGHTBOX ---- */
.gallery-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: .75rem;
}
@media(max-width:600px){ .gallery-grid { grid-template-columns: repeat(2,1fr); } }

.gallery-grid a {
  display: block; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color var(--ease), transform var(--ease);
}
.gallery-grid a:hover { border-color: var(--border2); transform: scale(1.02); }
.gallery-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; }

.lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.92); z-index: 200;
  align-items: center; justify-content: center;
}
.lightbox:target { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: var(--r-md); object-fit: contain; }
.lightbox .close {
  position: fixed; top: 1.5rem; right: 2rem;
  color: #fff; font-size: 2.2rem; text-decoration: none; opacity: .7;
}
.lightbox .close:hover { opacity: 1; color: #fff; }

/* ---- VIDEO WRAP ---- */
.video-wrap {
  position: relative; padding-bottom: 56.25%;
  border-radius: var(--r-md); overflow: hidden;
  background: var(--bg4); margin-bottom: 1rem;
}
.video-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

/* ---- BADGE / TAG ---- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; padding: .18rem .6rem;
  border-radius: var(--r-pill); border: 1px solid currentColor;
}
.tag {
  font-size: .68rem; color: var(--muted); background: var(--bg3);
  padding: .18rem .5rem; border-radius: 4px; letter-spacing: .04em;
}

/* ---- FILTER PILLS ---- */
.filter-pills { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.pill {
  background: transparent; border: 1px solid var(--border2);
  border-radius: var(--r-pill); color: var(--muted);
  font-size: .72rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  padding: .35rem .9rem; cursor: pointer;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
  white-space: nowrap;
}
.pill:hover { border-color: var(--border3); color: var(--text); }
.pill.active { color: #1a0f00; border-color: transparent; }

/* ---- SEARCH ---- */
.search-input {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--r-md); color: var(--text);
  font-family: var(--font-b); font-size: .9rem;
  padding: .5rem 1rem; outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15); }

/* ---- ACTIVE BANNER ---- */
.active-banner {
  background: linear-gradient(135deg, rgba(201,168,76,.08), rgba(192,34,42,.05));
  border: 1px solid rgba(201,168,76,.22);
  border-radius: var(--r-md);
  padding: 1rem 1.4rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 2rem;
}
.active-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--c-milestone); box-shadow: 0 0 10px var(--c-milestone);
  flex-shrink: 0; animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ---- TIMELINE ---- */
.timeline { position: relative; }
.timeline::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom,transparent,var(--border) 8%,var(--border) 92%,transparent);
}
.timeline-year {
  font-family: var(--font-d); font-size: .65rem;
  letter-spacing: .4em; text-transform: uppercase;
  color: var(--muted); padding: 1.8rem 0 1rem 2.25rem;
}
.timeline-entry { position: relative; padding: 0 0 1.5rem 2.25rem; }
.timeline-entry::before {
  content: ''; position: absolute; left: -5px; top: 1.25rem;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--ec, var(--gold)); box-shadow: 0 0 14px var(--ec, var(--gold));
  transition: transform .2s;
}
.timeline-entry:hover::before { transform: scale(1.4); }

.timeline-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.25rem 1.5rem;
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
  position: relative; overflow: hidden;
}
.timeline-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--ec, var(--gold)), transparent);
  opacity: 0; transition: opacity .25s;
}
.timeline-card:hover { border-color: var(--border2); background: var(--bg3); transform: translateX(4px); }
.timeline-card:hover::before { opacity: 1; }

/* ---- SCHEDULE CARDS ---- */
.schedule-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 2rem 1.5rem;
  text-align: center;
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.schedule-card:hover {
  border-color: var(--border2); transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,.3);
}
.schedule-card img {
  width: 120px; height: 120px; object-fit: cover;
  border-radius: var(--r-md); margin: 0 auto 1.2rem;
  border: 1px solid var(--border);
}
.schedule-card-day {
  font-family: var(--font-d); font-size: 1rem; font-weight: 800;
  letter-spacing: .06em; color: var(--text); margin-bottom: .3rem;
}
.schedule-card-time { font-size: .8rem; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1rem; }
.schedule-card-label { font-size: .95rem; font-weight: 600; color: var(--text2); margin-bottom: .4rem; }
.schedule-card-desc { font-size: .88rem; color: var(--muted); line-height: 1.6; }

/* ---- YOUTUBE GRID ---- */
.yt-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.25rem; }
@media(max-width:768px){ .yt-grid { grid-template-columns: repeat(2,1fr); } }
@media(max-width:480px){ .yt-grid { grid-template-columns: 1fr; } }

.yt-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden;
  text-decoration: none; display: block;
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.yt-card:hover { border-color: var(--border2); transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.3); }
.yt-thumb { position: relative; padding-bottom: 56.25%; overflow: hidden; }
.yt-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.yt-card:hover .yt-thumb img { transform: scale(1.05); }
.yt-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.32); opacity: 0; transition: opacity .25s;
}
.yt-card:hover .yt-play { opacity: 1; }
.yt-play svg { width: 46px; height: 46px; fill: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,.5)); }
.yt-info { padding: .85rem 1rem; }
.yt-title {
  font-size: .9rem; font-weight: 600; color: var(--text);
  margin-bottom: .3rem; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.yt-date { font-size: .78rem; color: var(--muted); }

/* ---- RESPONSIVE ---- */
@media(max-width:768px){
  section { padding: 3.5rem 0; }
  .page-hero { padding: 5rem 0 3.5rem; }
  .section-header p { font-size: 1rem; }
  .site-footer { padding: 3.5rem 0 1.5rem; margin-top: 5rem; }
  .footer-grid { gap: 2rem; }
}
