:root {
  --bg: #000000;
  --fg: #e8e8e8;
  --muted: #a0a0a0;
  --glow: rgba(255, 255, 255, 0.85);
  --glow-soft: rgba(255, 255, 255, 0.25);
  --panel: #0e0e0e;
  --panel-border: rgba(255, 255, 255, 0.12);
  --panel-hover: rgba(255, 255, 255, 0.06);
}

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

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Noto Sans TC",
    "PingFang TC",
    "Microsoft JhengHei",
    sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Language switcher */
.lang {
  position: fixed;
  top: clamp(1rem, 3vw, 1.75rem);
  right: clamp(1rem, 4vw, 2rem);
  z-index: 40;
}

.lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  padding: 0.45rem 0.75rem 0.45rem 0.85rem;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--fg);
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    color 0.25s ease;
}

.lang__btn:hover,
.lang__btn:focus-visible,
.lang.is-open .lang__btn {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(20, 20, 20, 0.9);
  outline: none;
}

.lang__chevron {
  width: 0.7rem;
  height: 0.7rem;
  opacity: 0.7;
  transition: transform 0.25s ease;
}

.lang.is-open .lang__chevron {
  transform: rotate(180deg);
}

.lang__menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 11.5rem;
  max-height: min(70vh, 22rem);
  overflow: auto;
  padding: 0.35rem;
  list-style: none;
  border: 1px solid var(--panel-border);
  border-radius: 0.85rem;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.lang__menu[hidden] {
  display: none;
}

.lang__option {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease;
}

.lang__option:hover,
.lang__option:focus-visible {
  background: var(--panel-hover);
  color: #fff;
  outline: none;
}

.lang__option.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(1.25rem, 3vw, 2rem);
  padding: clamp(4.5rem, 10vw, 6rem) clamp(2rem, 8vw, 6rem)
    clamp(2rem, 6vw, 3rem);
  max-width: 42rem;
}

.lead,
.about {
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  line-height: 1.7;
  color: var(--muted);
  max-width: 28rem;
}

.view {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  letter-spacing: 0.06em;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid rgba(232, 232, 232, 0.35);
  padding-bottom: 0.15em;
  transition:
    border-color 0.35s ease,
    color 0.35s ease;
}

.view:hover,
.view:focus-visible {
  border-color: #fff;
  outline: none;
}

.footer {
  padding: 0 clamp(2rem, 8vw, 6rem) clamp(2rem, 5vw, 3rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
}

.footer__logo {
  display: inline-flex;
  margin-bottom: 0.35rem;
  opacity: 0.85;
  transition:
    opacity 0.3s ease,
    filter 0.3s ease;
}

.footer__logo img {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
}

.footer__logo:hover,
.footer__logo:focus-visible {
  opacity: 1;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.45));
  outline: none;
}

.footer__line {
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(160, 160, 160, 0.85);
  letter-spacing: 0.01em;
}

.glow-text {
  transition:
    text-shadow 0.45s ease,
    color 0.45s ease,
    opacity 0.45s ease;
  will-change: text-shadow;
}

.glow-text.is-near {
  color: #fff;
  text-shadow:
    0 0 8px var(--glow),
    0 0 24px var(--glow-soft),
    0 0 48px rgba(255, 255, 255, 0.15);
}

.glow-text.is-hover {
  color: #fff;
  text-shadow:
    0 0 10px #fff,
    0 0 28px rgba(255, 255, 255, 0.55),
    0 0 56px rgba(255, 255, 255, 0.25);
}

@media (prefers-reduced-motion: reduce) {
  .glow-text,
  .lang__btn,
  .lang__chevron,
  .lang__option,
  .footer__logo {
    transition: none;
  }
}
