/* --------------------------------------------------
   Root Variables
-------------------------------------------------- */
:root {
  --grad-light-1: #f7f7f7;
  --grad-light-2: #e3e3e3;
  --grad-light-3: #d7dde8;

  --grad-dark-1: #1b1b24;
  --grad-dark-2: #111319;
  --grad-dark-3: #202436;
}

/* --------------------------------------------------
   Body
-------------------------------------------------- */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;

  background: linear-gradient(135deg, var(--grad-light-1), var(--grad-light-2), var(--grad-light-3));
  background-size: 200% 200%;
  animation: gradientShift 30s ease-in-out infinite, fadeIn 1.2s ease-out forwards;

  font-family: Arial, sans-serif;
  text-align: center;
  padding: 0 20px; /* TOP PADDING REMOVED */
  color: #333;

  opacity: 0;
  overflow-x: hidden;
  position: relative;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes gradientShift {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

/* --------------------------------------------------
   Background Layers
-------------------------------------------------- */
.background-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* --------------------------------------------------
   Watermark (Ambient Drift)
-------------------------------------------------- */
.watermark {
  position: absolute;
  will-change: transform;
  width: 140px;
  height: 140px;
  background-image: url("/img/logo128x128.png");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.10;
  filter: blur(1px);
  pointer-events: none;
  z-index: 0;
}

/* --------------------------------------------------
   Particles
-------------------------------------------------- */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  opacity: 0;
  animation: floatUp 18s linear infinite;
}

@keyframes floatUp {
  0% { transform: translateY(20vh); opacity: 0; }
  10% { opacity: 0.4; }
  80% { opacity: 0.2; }
  100% { transform: translateY(-20vh); opacity: 0; }
}

/* --------------------------------------------------
   Card
-------------------------------------------------- */
.card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
  padding: 40px 30px;
  border-radius: 16px;
  max-width: 480px;
  margin: 80px auto 40px auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  position: relative;
  z-index: 2;
  overflow: visible;
  border: 1px solid transparent;
}

/* Architectural Corner Accents */
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255,255,255,0.4);
  animation: cornerFade 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 3;
}

.card::before {
  top: -6px;
  left: -6px;
  border-right: none;
  border-bottom: none;
}

.card::after {
  bottom: -6px;
  right: -6px;
  border-left: none;
  border-top: none;
}

@keyframes cornerFade {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.6; }
}

/* --------------------------------------------------
   Logo
-------------------------------------------------- */
img.logo {
  width: 340px;
  max-width: 85%;
  margin-bottom: 24px;
  filter: drop-shadow(0px 4px 12px rgba(0,0,0,0.28));
  transition: transform 0.3s ease-out, filter 0.3s ease-out;
  animation: logoFloat 8s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

img.logo:hover {
  transform: translateY(-6px) scale(1.02);
  filter: drop-shadow(0px 6px 16px rgba(0,0,0,0.35));
}

/* --------------------------------------------------
   Footer
-------------------------------------------------- */
footer {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
  max-width: 480px;
  padding: 18px 20px;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  margin: 0 auto 20px auto;
  margin-top: auto;
  font-size: 0.95rem;
  color: #555;
  position: relative;
  z-index: 2;
}

footer a {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

footer a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------
   Hamburger + Menu (Future-Proof, Styled)
-------------------------------------------------- */

.hamburger {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 30px;
  height: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  z-index: 20;
  transition: transform 0.25s ease-out;
  animation: burgerIdle 8s ease-in-out infinite;
}

.hamburger span {
  height: 3px;
  background: #333;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* X state */
.hamburger.active span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

/* Dropdown Menu */
.hamburger-menu {
  position: fixed;
  top: 60px;
  right: 20px;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(8px);
  padding: 14px 20px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 15;

  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Visible state */
.hamburger-menu.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.hamburger-menu a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  padding: 6px 0;
  transition: opacity 0.2s ease;
}

.hamburger-menu a:hover {
  opacity: 0.7;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .hamburger span { background: #eee; }

  .hamburger-menu {
    background: rgba(40,40,40,0.85);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  }

  .hamburger-menu a {
    color: #eee;
  }
}
  
/* --------------------------------------------------
   Dark Mode
-------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, var(--grad-dark-1), var(--grad-dark-2), var(--grad-dark-3));
    color: #eee;
  }

  .card, footer {
    background: rgba(40, 40, 40, 0.78);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    color: #ccc;
  }

  .hamburger span { background: #eee; }
  .particle { background: rgba(255, 255, 255, 0.35); }
  .watermark { opacity: 0.14; filter: brightness(1.2) blur(1px); }
  img.logo { filter: brightness(1.35) drop-shadow(0px 6px 14px rgba(255,255,255,0.18)); }
}

/* --------------------------------------------------
   Terms of Use Page Styles
-------------------------------------------------- */

/* Collapsible Section Styles */
.collapsible {
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-size: 1.05rem;
  padding: 8px 0;
  font-weight: bold;
  outline: none;
}
.collapsible:after {
  content: "▼";
  float: right;
  transition: transform 0.3s ease;
}
.collapsible.active:after {
  transform: rotate(-180deg);
}

.content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
  padding-left: 8px;
}

.toc {
  margin-bottom: 16px;
  padding-left: 0;
}
.toc a {
  display: block;
  padding: 4px 0;
  color: #333;
  text-decoration: none;
  font-weight: 500;
}
.toc a:hover { text-decoration: underline; }

#toggleAll {
  display: block;
  margin-bottom: 12px;
  padding: 6px 12px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid #999;
  background: rgba(255,255,255,0.85);
  transition: background 0.2s ease;
}

@media (prefers-color-scheme: dark) {
  .toc a { color: #eee; }
  .collapsible { color: #eee; }
  #toggleAll { background: rgba(40,40,40,0.85); border-color: #ccc; color: #eee; }
}
