/* Root-absolute font URLs — work from both /css and /assets/css. */
@font-face {
  font-family: "Noto Sans TC";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/NotoSansTC-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Noto Sans TC";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/NotoSansTC-Medium.ttf") format("truetype");
}
@font-face {
  font-family: "Noto Sans TC";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/NotoSansTC-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "Noto Sans TC";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/NotoSansTC-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "Noto Serif TC";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/NotoSerifTC-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "Noto Sans KR";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/NotoSansKR-Medium.ttf") format("truetype");
}
@font-face {
  font-family: "Noto Sans KR";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/NotoSansKR-SemiBold.ttf") format("truetype");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

button,
a,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #000;
  color: #fff;
  font-family: "Noto Sans TC", sans-serif;
  overflow: hidden;
}

/* Home: no long-press text selection (legal pages stay selectable) */
.home-root,
.home-root *,
.drawer,
.drawer *,
.drawer-backdrop {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Prefer CSS animation; also honor .is-ready for older cached pages. */
body.page-fade {
  opacity: 0;
  animation: page-in 900ms ease-in forwards;
}

body.page-fade.is-ready {
  opacity: 1;
  animation: none;
}

@keyframes page-in {
  to {
    opacity: 1;
  }
}

body.legal-page {
  overflow: auto;
  -webkit-user-select: text;
  user-select: text;
}

/* ── Home shell ── */
.home-root {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
}

.bg-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#stars-canvas,
#grid-canvas,
#particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#grid-canvas {
  z-index: 0;
  pointer-events: none;
  touch-action: none;
}

#grid-canvas.is-warp-hit {
  pointer-events: auto;
}

#particles-canvas {
  z-index: 1;
  pointer-events: none;
}

.brand-layer,
.top-nav,
.page-footer {
  position: absolute;
  z-index: 2;
}

.brand-layer {
  inset: 0;
  pointer-events: none;
}

.brand-layer .eq-hit {
  pointer-events: auto;
}

.brand-mark {
  display: block;
  color: #fff;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

#brand-icon,
#brand-title,
#eq-row,
#pillars-row {
  position: absolute;
}

.brand-title {
  display: flex;
  margin: 0;
  padding: 0;
  font-family: "Noto Serif TC", serif;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 16px #000;
  line-height: 1;
}

.brand-title span {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  text-align: center;
  line-height: 1;
}

.eq-row,
.pillars-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.eq-cell,
.pillar-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  font-weight: 500;
  line-height: 1;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.eq-op {
  position: relative;
  overflow: hidden;
}

.eq-op-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 380ms cubic-bezier(0.33, 1, 0.68, 1),
    transform 380ms cubic-bezier(0.33, 1, 0.68, 1);
}

.eq-op-inner.is-hidden-up {
  opacity: 0;
  transform: translateY(-48%);
  pointer-events: none;
}

.eq-op-inner.is-hidden-down {
  opacity: 0;
  transform: translateY(48%);
  pointer-events: none;
}

.pillar-col {
  display: flex;
  flex-direction: column;
}

.pillar-cell {
  font-weight: 700;
}

.pillar-col.is-animating .pillar-cell {
  animation: pillar-swap 200ms ease-out;
}

.pillar-col.is-animating-slow .pillar-cell {
  animation: pillar-swap 400ms ease-out;
}

@keyframes pillar-swap {
  from {
    opacity: 0;
    transform: translateY(50%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Top nav ── */
.top-nav {
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 36px;
  padding-right: 36px;
  padding-bottom: 12px;
  z-index: 5;
}

.top-nav-desktop {
  display: flex;
  width: 100%;
  align-items: center;
}

.top-nav-spacer {
  flex: 1;
}

.top-nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 32px;
}

.nav-link {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2.6px;
  color: #fff;
  opacity: 0.72;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  transition: opacity 160ms ease;
  line-height: 1;
}

.nav-link:hover {
  opacity: 1;
}

.menu-btn {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  touch-action: manipulation;
}

.menu-btn:hover,
.menu-btn:active,
.menu-btn:focus,
.menu-btn:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  box-shadow: none;
}

.menu-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.top-brand {
  width: 64px;
  height: 64px;
  color: #fff;
}

.lang-dd {
  position: relative;
  height: 32px;
  display: flex;
  align-items: center;
  cursor: default;
}

.lang-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  background: none;
  border: 0;
  padding: 0;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}

.lang-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2.6px;
  line-height: 1;
  opacity: 0.72;
  transition: opacity 160ms ease;
  white-space: nowrap;
}

.lang-dd.is-open .lang-label {
  opacity: 1;
}

.lang-label.is-kr,
.lang-option.is-kr,
.drawer-lang-option.is-kr {
  font-family: "Noto Sans KR", sans-serif;
  letter-spacing: 0;
}

.lang-label.is-loose,
.lang-option.is-loose,
.drawer-lang-option.is-loose {
  letter-spacing: 0;
}

.lang-caret {
  width: 8px;
  height: 5px;
  transition:
    transform 180ms ease,
    opacity 160ms ease;
  opacity: 0.72;
}

.lang-dd.is-open .lang-caret {
  transform: rotate(180deg);
  opacity: 1;
}

.lang-menu {
  position: absolute;
  top: 100%;
  left: -24px;
  margin-top: 0;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: none;
  min-width: max-content;
  z-index: 20;
}

.lang-dd.is-open .lang-menu {
  display: block;
}

.lang-option {
  height: 38px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2.6px;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.lang-option:hover,
.lang-option.is-selected {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.lang-option.is-selected {
  font-weight: 600;
}

.page-footer {
  /* App about bottom padding ≈ safe-area + 20; sit a bit closer on web. */
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  left: 12px;
  right: 12px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 1.2px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.55);
  z-index: 3;
}

.page-footer .copy {
  display: inline-block;
  transform: translateY(0.8px);
}

/* Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 40;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(220px, 68vw);
  background: #000;
  transform: translateX(-105%);
  transition: transform 220ms ease;
  z-index: 50;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-brand {
  width: 56px;
  height: 56px;
  color: #fff;
  margin-bottom: 40px;
}

.drawer-link {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2.6px;
  color: rgba(255, 255, 255, 0.85);
  background: none;
  border: 0;
  padding: 6px 0;
  margin-bottom: 20px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}

.drawer-lang {
  margin-top: auto;
  padding-top: 24px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
}

.drawer-lang-option {
  display: block;
  padding: 10px 0;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2.6px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.drawer-lang-option.is-selected {
  color: #fff;
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .top-nav {
    padding-left: 16px;
    padding-right: 16px;
  }

  .top-nav-desktop {
    display: none !important;
  }

  .menu-btn {
    display: inline-flex;
  }
}

@media (min-width: 768px) {
  .menu-btn {
    display: none !important;
  }

  .drawer,
  .drawer-backdrop {
    display: none !important;
  }
}

/* ── Legal pages ── */
.legal-shell {
  min-height: 100%;
  background: #000;
  color: #fff;
  opacity: 0;
  transition: opacity 700ms ease-out;
}

.legal-shell.is-ready {
  opacity: 1;
}

.legal-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding-left: 36px;
  padding-right: 36px;
  height: calc(28px + 48px + 12px);
}

.legal-back {
  position: absolute;
  left: 36px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.legal-back:hover {
  background: rgba(255, 255, 255, 0.2);
}

.legal-back svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.legal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.legal-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
}

.legal-meta {
  margin-bottom: 48px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  line-height: 1.5;
}

.legal-section-heading {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.legal-section-body {
  margin: 0 0 48px;
  font-size: 16px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.78);
  white-space: pre-wrap;
}

@media (max-width: 599.98px) {
  .legal-bar {
    height: calc(16px + 48px + 12px);
    padding-left: 16px;
    padding-right: 16px;
  }

  .legal-back {
    left: 16px;
  }

  .legal-body {
    padding: 16px;
  }
}

/* ── 404 ── */
.not-found {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #000;
  color: #fff;
  font-size: 16px;
}

.not-found a {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 20px;
  background: #448aff;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
