/* Dark-theme first stylesheet for Keo landing page */
@font-face{
  font-family:"LightPixel";
  src:url("fonts/light_pixel-7.ttf") format("truetype");
}

:root{
  --bg:#0b0f12;
  --surface:#0f1417;
  --muted:#9aa6b2;
  --text:#e6eef3;
  --accent:#7bd389;
  --accent-2:#6ea8ff;
  --glass:rgba(255,255,255,0.03);
  --radius:12px;
  --max-width:1100px;
  --gap:1.25rem;
  --star-x:0px;
  --star-y:0px;
  --star-opacity:0.3;
  --star-duration:2s;
  font-size:16px;
}

[data-theme="light"]{
  --bg:#c9aaef;
  --surface:#dfd4f3;
  --muted:#556677;
  --text:#081024;
  --accent:#006644;
  --accent-2:#0057d9;
  --glass:rgba(0,0,0,0.03);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: "Atkinson Hyperlegible", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial;
  background:linear-gradient(180deg,var(--bg),var(--bg) 60%);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.45;
}

.container{max-width:var(--max-width);margin:0 auto;padding:0 1rem}

@media (min-width:1200px){
  .container{margin:0 auto;padding:0 2rem}
}
.site-header{backdrop-filter:blur(6px);}
.nav{display:flex;align-items:center;justify-content:space-between;padding:1rem 0;gap:1rem}
.brand{font-weight:700;color:var(--text);text-decoration:none;font-size:1.05rem}
.nav-links{list-style:none;margin:0;padding:0;display:flex;gap:0.75rem}
.nav-links a{color:var(--muted);text-decoration:none;padding:0.25rem 0.5rem;border-radius:8px}
.nav-links a:hover{color:var(--text);background:var(--glass)}
.theme-toggle{background:transparent;border:1px solid var(--glass);color:var(--text);padding:0.4rem 0.6rem;border-radius:8px;cursor:pointer}

.hero{padding:5.25rem 0 3rem}
.hero-inner{display:grid;grid-template-columns:240px 1fr;gap:1.5rem;align-items:center}
.hero-image img{width:100%;height:auto;display:block;border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,0.3)}
.hero-title{font-size:2.25rem;margin:0 0 0.5rem;font-family:"LightPixel",ui-sans-serif,system-ui}
.lead{color:var(--muted);max-width:65ch}

.btn{display:inline-block;padding:0.6rem 1rem;border-radius:10px;text-decoration:none;color:var(--text);border:1px solid var(--glass);background:transparent}
.btn.primary{background:linear-gradient(90deg,var(--accent),var(--accent-2));color:#042014;border:none}

.section{padding:2.25rem 0;border-top:1px solid var(--glass)}
.section h2{margin-top:0;font-family:"LightPixel",ui-sans-serif,system-ui}

.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem}
.card{background:var(--surface);padding:1rem;border-radius:var(--radius);box-shadow:0 6px 18px rgba(0,0,0,0.3)}
.thumb{height:140px;background-size:cover;background-position:center;border-radius:8px;margin-bottom:0.75rem}

.site-footer{padding:1.25rem 0;color:var(--muted);border-top:1px solid var(--glass);text-align:center}
.footer-license{height:40px;margin-top:0.75rem;display:inline-block}

/* Responsive tweaks */
@media (min-width:700px){
  .hero-title{font-size:3rem}
  /* two-column hero: image left, content right */
  .hero-inner{grid-template-columns:240px 1fr;max-width:1100px;margin:0 auto}
}

@media (max-width:600px){
  .hero-inner{grid-template-columns:1fr;align-items:flex-start}
  .hero-image{width:180px;margin:0 auto}
  .hero-title{font-size:1.2rem}
}

@media (max-width:480px){
  .nav-links{display:none}
  .hero{padding:3.5rem 0}
  .container{padding:0 1.5rem}
}

/* Utility */
.socials a{color:var(--muted);text-decoration:none}

/* Contact / Newsletter */
.contact-grid{display:grid;grid-template-columns:1fr 240px;gap:1rem;align-items:start}
.newsletter-form{background:transparent;padding:0;margin:0}
.newsletter-form label{display:block;margin-bottom:0.5rem;font-weight:600}
.field-row{display:flex;gap:0.5rem}
.newsletter-form input[type="email"]{flex:1;padding:0.6rem 0.75rem;border-radius:8px;border:1px solid var(--glass);background:transparent;color:var(--text)}
.newsletter-form input::placeholder{color:var(--muted)}
.newsletter-msg{margin-top:0.5rem;color:var(--muted);font-size:0.95rem}
.newsletter-msg.success{color:var(--accent)}
.newsletter-msg.error{color:#ff7b7b}
.socials-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:0.5rem}
.socials-list a{color:var(--muted);text-decoration:none;padding:0.25rem 0.5rem;border-radius:8px}
.socials-list a:hover{color:var(--text);background:var(--glass)}

@media (max-width:720px){
  .contact-grid{grid-template-columns:1fr}
  .socials-list{flex-direction:row;flex-wrap:wrap}
}

/* Worldbuilding Courtyard image layout */
.wb-grid{display:grid;grid-template-columns:320px 1fr;gap:1rem;align-items:start}
.wb-media img{width:100%;height:auto;border-radius:10px;display:block;box-shadow:0 8px 24px rgba(0,0,0,0.3)}
.wb-content h2{margin-top:0}

@media (min-width:821px){
    /* place media in the right column and keep it constrained */
    .wb-media{grid-column:2;justify-self:end}
    .wb-content{grid-column:1}
    .wb-media img{max-width:320px;width:100%;height:auto}
}

@media (max-width:820px){
  .wb-grid{grid-template-columns:1fr;align-items:center}
  .wb-media{order:0}
  .wb-content{order:1}
}

/* image credit / caption */
.wb-caption{display:block;margin-top:0.5rem;font-size:0.85rem;color:var(--muted);opacity:0.95}
.wb-caption{font-style:italic}

/* Partners / Powered By row */
.partners-row{display:flex;gap:1rem;align-items:center;flex-wrap:wrap;margin-top:0.75rem}
.partner{display:inline-flex;align-items:center;gap:0.75rem;padding:0.5rem 0.75rem;border-radius:10px;background:var(--surface);border:1px solid var(--glass);text-decoration:none;color:var(--text)}
.partner img{height:36px;width:auto;display:block}
.partner-name{font-weight:600;color:var(--text)}
.partner:hover{transform:translateY(-3px);box-shadow:0 10px 30px rgba(0,0,0,0.3)}

@media (max-width:560px){
  .partners-row{display:grid;grid-template-columns:1fr 1fr;gap:0.75rem}
  .partner{justify-content:flex-start}
}

/* Bibliography / References */
.bib-list{list-style:none;padding:0;margin:0;display:grid;gap:0.5rem}
.bib-list li{background:var(--surface);padding:0.75rem 0.85rem;border-radius:10px;border:1px solid var(--glass)}
.bib-list a{color:var(--accent-2);text-decoration:none;font-weight:600}
.bib-desc{display:block;color:var(--muted);font-size:0.92rem;margin-top:0.25rem}

@media (max-width:520px){
  .bib-list li{padding:0.6rem}
}

/* Mascot / attribution styling */
.mascot-credit{font-size:0.9rem;color:var(--muted);font-style:italic;margin-top:0.75rem}
.mascot-credit a{color:var(--accent-2)}

/* Animated soap bubbles for light theme */
@keyframes bubble-float {
  0% {
    bottom: -20px;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    bottom: 100vh;
    opacity: 0;
  }
}

@keyframes bubble-sway {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(30px);
  }
  75% {
    transform: translateX(-30px);
  }
}

[data-theme="light"] body::before {
  content: '';
  position: fixed;
  bottom: -20px;
  left: 10%;
  width: 40px;
  height: 40px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), rgba(200,150,255,0.3));
  border: 2px solid rgba(200,150,255,0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: bubble-float 8s ease-in infinite, bubble-sway 4s ease-in-out infinite;
}

[data-theme="light"] body::after {
  content: '';
  position: fixed;
  bottom: -30px;
  right: 15%;
  width: 30px;
  height: 30px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.7), rgba(180,140,255,0.2));
  border: 2px solid rgba(180,140,255,0.3);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: bubble-float 10s ease-in 1s infinite, bubble-sway 5s ease-in-out infinite;
}

/* Animated shooting star and twinkling stars for dark theme */
@keyframes shooting-star {
  0% {
    top: 10%;
    right: -50px;
    opacity: 1;
  }
  13.3% {
    top: 50%;
    right: 110vw;
    opacity: 0;
  }
  100% {
    top: 50%;
    right: 110vw;
    opacity: 0;
  }
}

@keyframes star-tail {
  0% {
    box-shadow: 
      0 0 40px 8px rgba(255, 215, 0, 0.9),
      0 0 60px 15px rgba(255, 255, 200, 0.5),
      0 0 80px 20px rgba(255, 215, 0, 0.2);
  }
  13.3% {
    box-shadow: 
      0 0 0 0 rgba(255, 215, 0, 0),
      0 0 0 0 rgba(255, 255, 200, 0),
      0 0 0 0 rgba(255, 215, 0, 0);
  }
  100% {
    box-shadow: 
      0 0 0 0 rgba(255, 215, 0, 0),
      0 0 0 0 rgba(255, 255, 200, 0),
      0 0 0 0 rgba(255, 215, 0, 0);
  }
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

@keyframes twinkle-slow {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.95;
  }
}

[data-theme="dark"] body::before {
  content: '';
  position: fixed;
  top: 10%;
  right: -50px;
  width: 8px;
  height: 8px;
  background: #ffd700;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: shooting-star 30s ease-in infinite, star-tail 30s ease-in infinite;
}

[data-theme="dark"] body::after {
  content: '';
  position: absolute;
  top: 20%;
  left: 15%;
  width: 4px;
  height: 4px;
  background: #ffd700;
  border-radius: 50%;
  box-shadow: 0 0 10px 1px rgba(255, 215, 0, 0.6);
  pointer-events: none;
  z-index: 0;
  animation: twinkle 2.5s ease-in-out infinite;
}

[data-theme="dark"] .site-header::before {
  content: '';
  position: fixed;
  left: var(--star-x);
  top: var(--star-y);
  width: 3px;
  height: 3px;
  background: #ffd700;
  border-radius: 50%;
  box-shadow: 0 0 8px 0.5px rgba(255, 215, 0, 0.5);
  pointer-events: none;
  z-index: 0;
  opacity: var(--star-opacity);
  transition: left var(--star-duration) ease-in-out, top var(--star-duration) ease-in-out, opacity var(--star-duration) ease-in-out;
}

[data-theme="dark"] .site-header::after {
  content: '';
  position: fixed;
  top: 370%;
  right: 18%;
  width: 4px;
  height: 4px;
  background: #ffd700;
  border-radius: 50%;
  box-shadow: 0 0 10px 1px rgba(255, 215, 0, 0.6);
  pointer-events: none;
  z-index: 0;
  animation: twinkle 2.5s ease-in-out infinite;
}
