@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap");

:root {
  --background-color: #f7f8fc;
  --text: #232534;
}

[data-theme="dark"] {
  --background-color: #05060a;
  --text: #f1f2f7;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Roboto", sans-serif;
  font-optical-sizing: auto;
}

html,
body {
  height: 100%;
}

body {
  background-color: var(--background-color);
  color: var(--text);
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* Background image layers */

.bg {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.bg-light {
  background-image: url("light.png");
  opacity: 1; /* default for light theme */
}

.bg-dark {
  background-image: url("dark.png");
}

/* When dark theme, fade from light -> dark */
[data-theme="dark"] .bg-light {
  opacity: 0;
}

[data-theme="dark"] .bg-dark {
  opacity: 1;
}

/* MAIN LAYOUT */

main {
  flex: 1;
  padding-top: 3.5rem;
  position: relative;
  z-index: 1; /* above background */
}

/* FOOTER */

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 3rem;
  font-size: 0.85rem;
  background-color: rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2;
}

/* TITLE */

h1 {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 6rem;
  position: relative;
  z-index: 1;
}

/* CENTER HELPER */

.center {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

/* GLASS CARD / BOX */

.box {
  position: relative;
  overflow: hidden; /* IMPORTANT */
  padding: 1rem 1.4rem;

  /* Light glass */
  background: rgba(255, 255, 255, 0.25);
  border-radius: 12px;

  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);

  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);

  margin-top: 1rem;
  max-width: 600px;
  width: calc(100% - 2rem);

  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    backdrop-filter 0.3s ease;
}

[data-theme="dark"] .box {
  background: rgba(0, 0, 0, 0.32);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}