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

:root {
  --bg: #0b0b0b;
  --text: #f5f5f5;
  --muted: rgba(245, 245, 245, 0.62);
  --soft: rgba(255, 255, 255, 0.06);
  --switch-bg: rgba(255, 255, 255, 0.12);
  --switch-border: rgba(255, 255, 255, 0.18);
  --switch-knob: #ffffff;
  --line-default: #f5f5f5;
  --line-fade: rgba(245, 245, 245, 0.38);
  --popup-bg: rgba(18, 18, 18, 0.68);
  --popup-border: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-border: rgba(255, 255, 255, 0.08);
}

html.light {
  --bg: #f7f4ef;
  --text: #111111;
  --muted: rgba(17, 17, 17, 0.62);
  --soft: rgba(0, 0, 0, 0.05);
  --switch-bg: rgba(0, 0, 0, 0.08);
  --switch-border: rgba(0, 0, 0, 0.12);
  --switch-knob: #111111;
  --line-default: #111111;
  --line-fade: rgba(17, 17, 17, 0.4);
  --popup-bg: rgba(255, 255, 255, 0.64);
  --popup-border: rgba(0, 0, 0, 0.08);
  --input-bg: rgba(255, 255, 255, 0.6);
  --input-border: rgba(0, 0, 0, 0.08);
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 60% at 50% 40%, var(--soft), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

.login-popup {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  pointer-events: none;
  z-index: 25;
  width: min(190px, calc(100vw - 20px));
  padding: 0.55rem 0.6rem 0.65rem;
  border-radius: 12px;
  background: var(--popup-bg);
  border: 1px solid var(--popup-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.login-popup.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.login-popup.is-hidden {
  display: none;
}

.login-close {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
}

.login-copy {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
  color: var(--text);
  opacity: 0.72;
}

.login-form {
  display: grid;
  gap: 0.35rem;
}

.login-input {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 9px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  outline: none;
  font: inherit;
  font-size: 0.74rem;
}

.login-input::placeholder {
  color: var(--muted);
}

.login-input:focus {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.login-button {
  margin-top: 0.05rem;
  border: 0;
  border-radius: 9px;
  padding: 0.5rem 0.6rem;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font: inherit;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.login-error {
  min-height: 1em;
  font-size: 0.65rem;
  line-height: 1.3;
  color: var(--text);
  opacity: 0.75;
  letter-spacing: 0.04em;
}

.theme-switch {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

html.light .theme-switch {
  background: rgba(255, 255, 255, 0.55);
}

.theme-text {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  user-select: none;
}

.switch {
  position: relative;
  width: 52px;
  height: 30px;
  border: 1px solid var(--switch-border);
  background: var(--switch-bg);
  border-radius: 999px;
  cursor: pointer;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--switch-knob);
  transition: transform 0.35s ease;
}

html.light .switch::after {
  transform: translateX(22px);
}

.brand {
  padding-top: 18vh;
  text-align: center;
}

.logo-wrap {
  display: inline-block;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 1.2s ease forwards 0.4s;
}

.logo-img {
  width: 24px;
  height: auto;
  display: block;
  filter: brightness(0) invert(1);
}

html.light .logo-img {
  filter: brightness(0) invert(0);
}

.scroll-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 2rem;
}

.scroll-content {
  text-align: center;
  max-width: 560px;
}

.line {
  font-size: clamp(1.08rem, 3vw, 1.72rem);
  font-weight: 300;
  letter-spacing: 0.1em;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(24px);
  color: var(--line-default);
  transition: opacity 1.1s ease, transform 1.1s ease, color 0.9s ease;
}

.line + .line {
  margin-top: 12px;
}

.line.visible {
  opacity: 1;
  transform: translateY(0);
}

.line.fade {
  opacity: 0.42;
  color: var(--line-fade);
}

.footer {
  padding: 2rem;
  text-align: center;
}

.small {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  opacity: 0.6;
  text-transform: uppercase;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
