:root[data-theme="light"] {
  --bg: #ffffff;
  --text: #000000;
  --box: #f5f5f58e;
  --link: #0047ab;
  --accent: #111111;
  --star-color: #222222;
}

:root[data-theme="dark"] {
  --bg: #0d1117;
  --text: #ffffff;
  --box: #161b2288;
  --link: #58a6ff;
  --accent: #ccc;
  --star-color: #58a6ff;
}

* {
  box-sizing: border-box;
}

/* Ensure html and body always fill the viewport */
html {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-width: 100vw;
  width: 100vw;
  height: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-width: 100vw;
  width: 100vw;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  transition: background 0.3s, color 0.3s;
  box-sizing: border-box;
  overflow-x: hidden;

  /* Center content vertically and horizontally */
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas#stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  min-width: 100vw;
  min-height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  z-index: -1;
  pointer-events: none;
  background: transparent;
  display: block;
}

.container {
  max-width: 600px;
  width: 95vw;
  padding: 3.5rem 1.9rem;
  background-color: var(--box);
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.966);
  z-index: 1;
  position: relative;
  text-align: center;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* Place the theme switch at the top INSIDE the container */
.theme-switch {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 2;
}

h1 {
  font-size: 2.3rem;
  margin-bottom: 2rem;
  color: var(--heading);
  font-family: 'Proxima Nova', 'Roboto', 'Inter', sans-serif;
  word-break: break-word;
}

.tagline {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--accent);
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.links a {
  display: inline-block;
  margin: 2rem 1rem;
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
  text-align: center;
  word-break: break-word;
}

button, .copy-btn {
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  background-color: var(--link);
  color: var(--bg);
  cursor: pointer;
  transition: background 0.3s, opacity 0.2s;
  margin-top: 1rem;
  word-break: break-word;
  max-width: 100%;
}

button:hover, .copy-btn:hover {
  opacity: 0.9;
}

.theme-switch {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 999;
  width: 64px;   /* was 48px */
  height: 28px;
  display: flex;
  align-items: center;
}

/* Hide the default checkbox */
.theme-switch input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.theme-switch .slider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  min-width: 48px;
  width: 100%;
  height: 100%;
  background: #ccc;
  border-radius: 34px;
  transition: background 0.3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  border: 1px solid #eee;
  overflow: hidden;
}

.theme-switch .slider:before {
  content: "🌞";
  position: absolute;
  left: 2px;
  top: 4px;
  width: 24px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s, width 0.3s, height 0.3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
}

/* Checked state (dark mode) */
.theme-switch input:checked + .slider:before {
  content: "🌙";
  background: transparent;    /* Remove white circle for moon */
  box-shadow: none;           /* Remove shadow for moon */
  color: #58a6ff;             /* Optional: make moon blue */
  /* Move the knob to the end, but keep it inside the track */
  transform: translateX(22px);
}

/* Checked state */
.theme-switch input:checked + .slider {
  background: #006dd3;; /* Apple green */
}

.copy-btn {
  display: inline-block;
  background-color: #222;
  color: #fff;
  font-size: 0.9rem;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  border: 1px solid #444;
}
#siahbot {
  position: fixed;
  right: 2vw;
  bottom: 2vw;
  font-size: 3rem;
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.2s;
}
#siahbot:hover {
  transform: scale(1.15) rotate(-10deg);
}

/* Responsive Styles */
@media (max-width: 900px) {
  .container {
    max-width: 98vw;
    margin: 4vh auto;
    padding: 1.6rem 0.7rem;
  }
  h1 {
    font-size: 1.7rem;
  }
  .links a {
    margin: 1rem 0.5rem;
    font-size: 1rem;
  }
}

/* Responsive adjustments for phones and tall/narrow screens */
@media (max-width: 600px), (max-aspect-ratio: 4/5) {
  .container {
    max-width: 99vw;
    margin: 2vh auto;
    padding: 0.7rem 0.3rem;
    border-radius: 7px;
  }
  h1 {
    font-size: 1.1rem;
    margin-bottom: 0.7rem;
  }
  .tagline {
    font-size: 0.8rem;
  }
  .links {
    flex-direction: column;
    gap: 0.4rem;
  }
  .links a {
    margin: 0.4rem 0;
    font-size: 0.95rem;
    padding: 0.5rem 0.8rem;
  }
  .theme-switch {
    top: 0.7rem;
    right: 0.7rem;
    width: 36px;
    height: 22px;
  }
  .theme-switch .slider {
    min-width: 36px;
    min-height: 22px;
    width: 100%;
    height: 100%;
  }
  .theme-switch .slider:before {
    width: calc(100% / 2.4);
    height: calc(100% - 8px);
    left: 2px;
    top: 2px;
    font-size: 0.95rem;
  }
  .theme-switch input:checked + .slider:before {
    transform: translateX(12px);
  }
  #siahbot {
    right: 2vw;
    bottom: 2vw;
    font-size: 1.7rem;
  }
  button, .copy-btn {
    font-size: 0.9rem;
    padding: 0.4rem 0.7rem;
    margin-top: 0.5rem;
  }
}

/* Extra: handle ultra-wide screens */
@media (min-aspect-ratio: 21/9) {
  .container {
    margin-top: 4vh;
    margin-bottom: 4vh;
  }
}

:root[data-theme="light"] .theme-switch .slider {
  background: #fff;
  border: 1px solid #eee;
}

:root[data-theme="light"] .theme-switch .slider:before {
  background: #fff;
  color: #fbc02d; /* Optional: sun color */
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
/* stack + center */
.portal-buttons{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;            /* space between buttons */
  margin:18px 0 8px;
}

/* shared button look */
.btn{
  display:inline-block;
  min-width: 260px;    /* makes both same width */
  text-align:center;
  padding:12px 18px;
  border-radius:12px;
  font-weight:700;
  text-decoration:none;
  transition:transform .15s ease, filter .15s ease, box-shadow .15s ease;
}

/* glowing primary */
.btn-primary{
  background: #00fff0;            /* match your cyan */
  color:#07161b;
  box-shadow:
    0 10px 24px rgba(0,255,240,.35),
    0 0 32px rgba(0,255,240,.25) inset;
}
.btn-primary:hover{ transform: translateY(-1px); filter: brightness(1.05); }
.btn-primary:active{ transform: translateY(1px); }

/* optional: if you want SiahCloud a bit subtler, give it this class instead:
   <a class="btn btn-secondary" ...> */
.btn-secondary{
  background: rgba(0,255,240,.12);
  color:#dff6f8;
  border: 2px solid rgba(0,255,240,.45);
  box-shadow: 0 6px 16px rgba(0,255,240,.18);
}
.btn-secondary:hover{ filter: brightness(1.1); transform: translateY(-1px); }
