/* ============================================================
   QwakLab — style.css
   Gothic laboratory aesthetic matching the alchemist image
   ============================================================ */

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

:root {
  --gold:        #c9a84c;
  --gold-light:  #e8d08a;
  --gold-dark:   #7a5c1e;
  --ink:         #0d0b08;
  --parchment:   #f0e6c8;
  --mist:        rgba(13, 11, 8, 0.72);
  --glow-blue:   #4ab8e8;
  --glow-purple: #a855f7;
  --glow-green:  #22c55e;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'IM Fell English', Georgia, serif;
  background-color: var(--ink);
  color: var(--parchment);
  overflow-x: hidden;
}

/* ── Fixed background image ────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('bg.jpg') center center / cover no-repeat;
  z-index: -2;
}

/* Dark layer over background so text stays readable */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8, 6, 4, 0.55) 0%,
    rgba(8, 6, 4, 0.45) 40%,
    rgba(8, 6, 4, 0.70) 100%
  );
  z-index: -1;
}

/* ── HERO ───────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(74, 184, 232, 0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.logo-seal {
  font-size: 4rem;
  filter: drop-shadow(0 0 18px var(--glow-blue));
  animation: pulse-glow 3s ease-in-out infinite;
}

.hero-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold-light);
  text-shadow:
    0 0 30px rgba(201, 168, 76, 0.6),
    0 0 80px rgba(201, 168, 76, 0.25),
    2px 2px 0 var(--ink);
  line-height: 1;
}

.hero-subtitle {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: var(--parchment);
  letter-spacing: 0.05em;
  text-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
  opacity: 0.9;
}

.scroll-hint {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  opacity: 0.55;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: float 2.5s ease-in-out infinite;
}

.scroll-arrow {
  font-size: 1.4rem;
}

/* ── CONTENT SECTIONS ───────────────────────────────────── */
.content-section {
  padding: 6rem 2rem;
  display: flex;
  align-items: center;
  min-height: 50vh;
}

.content-section.left {
  justify-content: flex-start;
}

.content-section.right {
  justify-content: flex-end;
}

.section-inner {
  max-width: 520px;
  width: 100%;
}

.text-block {
  background: linear-gradient(
    135deg,
    rgba(13, 11, 8, 0.88) 0%,
    rgba(26, 18, 6, 0.82) 100%
  );
  border: 1px solid var(--gold-dark);
  border-radius: 2px;
  padding: 2.5rem 2.8rem;
  position: relative;
  backdrop-filter: blur(6px);
  box-shadow:
    0 0 0 1px rgba(201, 168, 76, 0.08),
    0 8px 40px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(201, 168, 76, 0.15);
  transition: box-shadow 0.4s ease, transform 0.4s ease;
  opacity: 0;
  transform: translateY(30px);
}

.text-block.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease, transform 0.7s ease, box-shadow 0.4s ease;
}

.text-block:hover {
  box-shadow:
    0 0 0 1px rgba(201, 168, 76, 0.25),
    0 12px 60px rgba(0, 0, 0, 0.7),
    0 0 30px rgba(74, 184, 232, 0.08),
    inset 0 1px 0 rgba(201, 168, 76, 0.25);
}

/* Corner ornaments */
.text-block::before,
.text-block::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--gold);
  border-style: solid;
}

.text-block::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.text-block::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

.section-icon {
  font-size: 2rem;
  margin-bottom: 0.8rem;
  filter: drop-shadow(0 0 10px var(--glow-blue));
}

.text-block h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.08em;
  margin-bottom: 1.1rem;
  text-shadow: 0 0 15px rgba(201, 168, 76, 0.4);
}

.text-block p {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--parchment);
  opacity: 0.88;
  margin-bottom: 0.9rem;
}

.text-block p:last-child {
  margin-bottom: 0;
  font-style: italic;
  opacity: 0.7;
}

/* Alternating section backgrounds */
.content-section:nth-child(odd) {
  background: radial-gradient(
    ellipse at 20% 50%,
    rgba(168, 85, 247, 0.05) 0%,
    transparent 60%
  );
}

.content-section:nth-child(even) {
  background: radial-gradient(
    ellipse at 80% 50%,
    rgba(74, 184, 232, 0.05) 0%,
    transparent 60%
  );
}

/* ── FOOTER ─────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 4rem 2rem 3rem;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(8, 6, 4, 0.85)
  );
  border-top: 1px solid var(--gold-dark);
  position: relative;
}

.footer-seal {
  font-size: 2.5rem;
  color: var(--gold);
  filter: drop-shadow(0 0 12px rgba(201, 168, 76, 0.5));
  margin-bottom: 0.5rem;
}

.footer-name {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: var(--gold-light);
  letter-spacing: 0.2em;
  margin-bottom: 0.3rem;
}

.footer-sub {
  font-style: italic;
  color: var(--parchment);
  opacity: 0.65;
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--parchment);
  opacity: 0.35;
  letter-spacing: 0.04em;
}

/* ── ANIMATIONS ─────────────────────────────────────────── */
@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 18px var(--glow-blue)); }
  50%       { filter: drop-shadow(0 0 35px var(--glow-purple)) drop-shadow(0 0 15px var(--glow-green)); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(8px); }
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 700px) {
  .content-section.left,
  .content-section.right {
    justify-content: center;
  }

  .text-block {
    padding: 1.8rem 1.6rem;
  }

  .text-block h2 {
    font-size: 1.15rem;
  }
}

/* ── SIDEBAR ────────────────────────────────────────────── */

/* Toggle button — always visible, top-left */
.sidebar-toggle {
  position: fixed;
  top: 1.4rem;
  left: 1.4rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(13,11,8,0.92), rgba(26,18,6,0.88));
  border: 1px solid var(--gold-dark);
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  padding: 0.55rem 1rem 0.55rem 0.8rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.sidebar-toggle:hover {
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(201,168,76,0.25), 0 0 6px rgba(74,184,232,0.2);
  transform: translateY(-1px);
}

.toggle-icon {
  font-size: 1.1rem;
  filter: drop-shadow(0 0 6px var(--glow-blue));
  transition: filter 0.3s;
}

.sidebar-toggle:hover .toggle-icon {
  filter: drop-shadow(0 0 10px var(--glow-purple));
}

/* Backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 299;
  background: rgba(8,6,4,0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.sidebar-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

/* Sidebar panel */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 300px;
  z-index: 300;
  background: linear-gradient(
    160deg,
    rgba(10,8,4,0.97) 0%,
    rgba(20,13,4,0.97) 100%
  );
  border-right: 1px solid var(--gold-dark);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 40px rgba(0,0,0,0.7), 1px 0 0 rgba(201,168,76,0.08);
}

.sidebar.open {
  transform: translateX(0);
}

/* Header */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1.5rem 1.4rem 1.2rem;
}

.sidebar-seal {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 8px var(--glow-blue));
}

.sidebar-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.15em;
  flex: 1;
  text-shadow: 0 0 12px rgba(201,168,76,0.4);
}

.sidebar-close {
  background: none;
  border: 1px solid transparent;
  color: var(--parchment);
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.45;
  padding: 0.2rem 0.4rem;
  border-radius: 2px;
  transition: opacity 0.2s, border-color 0.2s;
}

.sidebar-close:hover {
  opacity: 1;
  border-color: var(--gold-dark);
}

/* Divider */
.sidebar-divider {
  height: 1px;
  margin: 0 1.4rem 1.2rem;
  background: linear-gradient(to right, transparent, var(--gold-dark), transparent);
}

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.8rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dark) transparent;
}

.sidebar-section-label {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.6;
  padding: 0 0.6rem 0.5rem;
  margin-bottom: 0.3rem;
}

.sidebar-nav ul {
  list-style: none;
  margin-bottom: 1.2rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  border-radius: 2px;
  text-decoration: none;
  color: var(--parchment);
  font-size: 0.92rem;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  position: relative;
}

.sidebar-link:hover {
  background: rgba(201,168,76,0.07);
  border-color: rgba(201,168,76,0.2);
  color: var(--gold-light);
}

.sidebar-link--dim {
  opacity: 0.55;
}

.sidebar-link--dim:hover {
  opacity: 0.85;
}

.link-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
}

.link-text {
  flex: 1;
  font-family: 'IM Fell English', serif;
}

.link-arrow {
  font-size: 0.85rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
  color: var(--gold);
}

.sidebar-link:hover .link-arrow {
  opacity: 1;
  transform: translateX(0);
}

.link-status {
  font-size: 0.6rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.1em;
  color: var(--glow-purple);
  border: 1px solid rgba(168,85,247,0.35);
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
}

/* Submenu groups */
.sidebar-group {
  margin-bottom: 0.5rem;
}

.sidebar-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem 0.35rem;
  background: none;
  border: none;
  outline: none;
  color: var(--gold);
  opacity: 0.65;
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s, color 0.2s;
}

.sidebar-group-toggle:hover {
  opacity: 1;
  color: var(--gold-light);
}

.sidebar-group-toggle:focus-visible {
  outline: 1px solid var(--gold-dark);
  border-radius: 2px;
}

.group-icon {
  font-size: 0.85rem;
  flex-shrink: 0;
  opacity: 0.9;
}

.group-label {
  flex: 1;
  text-align: left;
}

.group-chevron {
  font-size: 0.5rem;
  transition: transform 0.25s ease;
}

.sidebar-group-toggle[aria-expanded="false"] .group-chevron {
  transform: rotate(-90deg);
}

.sidebar-group-items {
  list-style: none;
  overflow: hidden;
  max-height: 400px;
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  margin-bottom: 0.3rem;
  border-left: 1px solid rgba(201,168,76,0.12);
  margin-left: 1rem;
}

.sidebar-group-items.collapsed {
  max-height: 0;
  opacity: 0;
}

.sidebar-group-items .sidebar-link {
  padding-left: 1rem;
  font-size: 0.88rem;
}

/* Footer */
.sidebar-footer {
  padding: 1rem 1.4rem;
  font-size: 0.7rem;
  font-style: italic;
  color: var(--parchment);
  opacity: 0.25;
  border-top: 1px solid rgba(201,168,76,0.12);
  text-align: center;
  letter-spacing: 0.08em;
}

/* ── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--ink);
}

::-webkit-scrollbar-thumb {
  background: var(--gold-dark);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}
