/* ============================================================
   base.css: 変数・リセット・共通コンポーネント
   テーマカラーはJS（render.js）がconfigから上書きする
============================================================ */
:root {
  color-scheme: dark;
  --c-primary: #ff79bd;
  --c-secondary: #aab8ff;
  --c-accent: #f7bfd8;
  --c-bg: #07091a;
  --c-bg-soft: #0d1230;
  --c-text: #f6f7ff;
  --c-text-dim: #c6cce2;
  --c-card: rgba(18, 22, 50, 0.74);
  --c-card-border: rgba(255, 255, 255, 0.13);
  --surface-1: rgba(12, 15, 34, 0.92);
  --surface-2: rgba(20, 25, 56, 0.82);
  --surface-3: rgba(34, 29, 63, 0.74);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --glow: rgba(255, 121, 189, 0.42);
  --glow-soft: rgba(170, 184, 255, 0.22);
  --shadow-deep: 0 28px 80px rgba(0, 0, 0, 0.52);
  --shadow-glow: 0 0 34px rgba(255, 121, 189, 0.28);
  --font-body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-num: "Orbitron", "Roboto Mono", monospace;
  --radius: 8px;
  --header-h: 76px;
  --max: 1080px;
}

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

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
  background: var(--c-bg);
}

body {
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(7, 9, 26, 0.98) 0%, rgba(11, 13, 31, 0.94) 48%, #060711 100%),
    var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 121, 189, 0.16), transparent 32rem),
    radial-gradient(circle at 84% 22%, rgba(170, 184, 255, 0.12), transparent 30rem),
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.45) 62%, transparent);
}

body.intro-lock { overflow: hidden; }

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--c-accent);
  text-underline-offset: 0.18em;
}

::selection {
  color: #08101f;
  background: #ffd7ea;
}

:focus-visible {
  border-radius: 4px;
  outline: 3px solid var(--c-accent);
  outline-offset: 4px;
}

.ja-heading {
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-break: strict;
}

.jp-wrap {
  overflow-wrap: anywhere;
  line-break: strict;
}

/* ---- 固定ヘッダー ---- */
.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 700;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 3vw, 34px);
  min-height: var(--header-h);
  padding: 13px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(7, 9, 26, 0.94), rgba(7, 9, 26, 0.78)),
    rgba(7, 9, 26, 0.86);
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.3);
}

html:not(.site-unlocked) .site-header .site-nav {
  visibility: hidden;
}

.site-brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 138px;
  min-height: 44px;
  color: var(--c-text);
  font-family: var(--font-num);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
  text-decoration: none;
}

.site-brand::before {
  width: 28px;
  height: 28px;
  margin-right: 10px;
  content: "";
  border: 1px solid rgba(255, 121, 189, 0.72);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255, 121, 189, 0.92), rgba(170, 184, 255, 0.32)),
    #101633;
  box-shadow: 0 0 20px rgba(255, 121, 189, 0.34), inset 0 0 18px rgba(255, 255, 255, 0.16);
}

.site-brand::after {
  content: "ALISA OFF-KAI";
}

.site-brand:has(#site-logo:not([hidden]))::before,
.site-brand:has(#site-logo-text:not([hidden]))::before {
  content: none;
}

.site-brand:has(#site-logo:not([hidden]))::after,
.site-brand:has(#site-logo-text:not([hidden]))::after {
  content: none;
}

#site-logo {
  width: auto;
  height: 34px;
}

#site-logo-text {
  color: var(--c-text);
}

.site-nav-wrap {
  position: relative;
  min-width: 0;
}

.site-nav-wrap::before,
.site-nav-wrap::after {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: 28px;
  pointer-events: none;
  content: "";
}

.site-nav-wrap::before {
  left: 0;
  background: linear-gradient(90deg, rgba(7, 9, 26, 0.96), transparent);
}

.site-nav-wrap::after {
  right: 0;
  background: linear-gradient(270deg, rgba(7, 9, 26, 0.96), transparent);
}

.site-nav {
  display: flex;
  justify-content: flex-end;
  gap: clamp(12px, 2vw, 24px);
  min-width: 0;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--c-text-dim);
  font-family: var(--font-num);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
  transition: color 0.18s ease, text-shadow 0.18s ease;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: 7px;
  left: 0;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--c-primary), transparent);
  opacity: 0;
  transform: scaleX(0.6);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: #fff;
  text-shadow: 0 0 18px var(--glow);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  opacity: 1;
  transform: scaleX(1);
}

/* ---- イントロ ---- */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: none;
  place-items: center;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(255, 121, 189, 0.16), transparent 24rem),
    #050616;
}

.intro-overlay.is-playing {
  display: grid;
  pointer-events: auto;
  animation: introFade 2.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro-overlay.intro-done {
  display: none !important;
  pointer-events: none !important;
}

.intro-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(86vw, 760px);
  min-height: 250px;
  overflow: hidden;
}

.intro-stage::before,
.intro-stage::after {
  position: absolute;
  left: 10%;
  width: 80%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  opacity: 0.7;
}

.intro-stage::before { top: 28px; }
.intro-stage::after { bottom: 28px; }

.intro-spark {
  position: absolute;
  top: 50%;
  left: 30%;
  z-index: 1;
  width: 40%;
  height: 4px;
  background: linear-gradient(90deg, transparent, #fff 12%, #ff8fc8 40%, #ff4fab 68%, transparent);
  box-shadow: 0 0 20px rgba(255, 121, 189, 0.74), 0 0 42px rgba(170, 184, 255, 0.32);
  opacity: 0;
  transform: translate3d(-160%, -50%, 0) skewX(-18deg) scaleX(0.48);
  will-change: transform, opacity;
  animation: sparkSlash 0.86s cubic-bezier(0.68, 0, 0.2, 1) 0.12s forwards;
}

.intro-brand {
  position: relative;
  z-index: 2;
  color: #fff;
  font-family: var(--font-num);
  font-size: clamp(3.3rem, 13vw, 8.8rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 0.92;
  padding-left: 0.18em;
  text-shadow:
    0 16px 40px rgba(0, 0, 0, 0.82),
    0 0 34px rgba(255, 121, 189, 0.56);
  opacity: 0;
  transform: translate3d(0, 8px, 0) scale(0.92);
  will-change: transform, opacity;
  animation: brandStamp 1s cubic-bezier(0.2, 0.9, 0.18, 1) 0.42s forwards;
}

.intro-logo:not([hidden]) {
  position: relative;
  z-index: 2;
  display: block;
  width: min(72vw, 520px);
  height: auto;
  opacity: 0;
  filter: drop-shadow(0 18px 38px rgba(0, 0, 0, 0.72)) drop-shadow(0 0 24px rgba(255, 121, 189, 0.42));
  transform: translate3d(0, 8px, 0) scale(0.94);
  will-change: transform, opacity;
}

html[data-intro-style="logo"] .intro-logo:not([hidden]) {
  animation: logoReveal 1.1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.42s forwards;
}

html[data-intro-style="logo"] .intro-logo:not([hidden]) + .intro-brand {
  display: none;
}

/* ---- カーソル追従グロー ---- */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 650;
  width: clamp(220px, 28vw, 440px);
  height: clamp(220px, 28vw, 440px);
  pointer-events: none;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 121, 189, 0.22) 0 10%, rgba(255, 121, 189, 0.1) 30%, transparent 64%),
    radial-gradient(circle, rgba(170, 184, 255, 0.15) 0 18%, transparent 66%);
  mix-blend-mode: screen;
  opacity: 0;
  transform: translate3d(-50vw, -50vh, 0);
  transition: opacity 0.28s ease, scale 0.18s ease;
  will-change: transform, opacity, scale;
}

.cursor-glow.is-active { opacity: 0.72; }
.cursor-glow.is-pulsing { scale: 1.06; }

@media (hover: none), (pointer: coarse) {
  .cursor-glow { display: none; }
}

/* ---- セクション共通 ---- */
.section {
  position: relative;
  z-index: 1;
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: clamp(64px, 9vw, 118px) clamp(18px, 4vw, 34px) 0;
  scroll-margin-top: calc(var(--header-h) + 10px);
}

.section-title {
  display: grid;
  justify-items: center;
  gap: 5px;
  margin-bottom: clamp(30px, 5vw, 54px);
  text-align: center;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.sec-label-en {
  color: var(--c-primary);
  font-family: var(--font-num);
  font-size: clamp(0.74rem, 1.2vw, 0.88rem);
  font-weight: 700;
  letter-spacing: 0.48em;
  padding-left: 0.48em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(255, 121, 189, 0.44);
}

.sec-label-ja {
  color: var(--c-text);
  font-size: clamp(1.55rem, 4vw, 2.35rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.28;
  padding-left: 0.08em;
}

.section-title::after {
  width: 68px;
  height: 2px;
  margin-top: 13px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--c-primary), var(--c-secondary), transparent);
  box-shadow: 0 0 18px var(--glow);
}

/* ---- カードパネル共通 ---- */
.card-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4.5vw, 42px);
  border: 1px solid var(--c-card-border);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), transparent 38%),
    linear-gradient(180deg, var(--surface-2), var(--surface-1));
  box-shadow: var(--shadow-deep);
}

.card-panel::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 121, 189, 0.24), transparent 32%, rgba(170, 184, 255, 0.16) 70%, transparent);
  opacity: 0.46;
}

.card-panel > * {
  position: relative;
  z-index: 1;
}

/* ---- CTAボタン共通 ---- */
.cta-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  min-width: 170px;
  overflow: hidden;
  padding: 14px 38px;
  border: 1px solid rgba(255, 195, 222, 0.45);
  border-radius: 6px;
  background:
    linear-gradient(120deg, #ff5cad, #e991bd 48%, #aab8ff),
    var(--c-primary);
  color: #08101f;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 16px 40px rgba(255, 121, 189, 0.26);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cta-button::after {
  position: absolute;
  inset: -1px;
  content: "";
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.48) 42%, transparent 64%);
  opacity: 0;
  transform: translateX(-96%);
  transition: opacity 0.18s ease, transform 0.46s ease;
}

.cta-button:hover,
.cta-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.68);
  box-shadow: 0 22px 56px rgba(255, 121, 189, 0.36), 0 0 30px rgba(170, 184, 255, 0.18);
  transform: translateY(-3px);
}

.cta-button:hover::after,
.cta-button:focus-visible::after {
  opacity: 1;
  transform: translateX(96%);
}

.cta-button:active { transform: translateY(0); }

.cta-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

/* ---- ピル型リンク ---- */
.pill-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 20px;
  border: 1px solid rgba(170, 184, 255, 0.58);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--c-text);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, color 0.22s ease, background 0.22s ease;
}

.pill-link:hover,
.pill-link:focus-visible {
  border-color: rgba(255, 121, 189, 0.78);
  background: rgba(255, 121, 189, 0.12);
  color: #fff;
  box-shadow: 0 0 24px rgba(255, 121, 189, 0.2);
}

/* ---- スクロールリビール ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.72s ease, transform 0.72s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---- フッター ---- */
.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: clamp(72px, 10vw, 130px);
  padding: 30px 20px 36px;
  border-top: 1px solid var(--line);
  background: rgba(6, 7, 17, 0.76);
}

.copyright {
  color: var(--c-text-dim);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: rgba(198, 204, 226, 0.46);
  transition: color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.admin-link:hover,
.admin-link:focus-visible {
  color: var(--c-accent);
  background: rgba(255, 121, 189, 0.1);
  box-shadow: 0 0 18px rgba(255, 121, 189, 0.18);
}

/* ===== 閲覧パスワードゲート（簡易・解錠状態は端末localStorageに記憶） ===== */
.site-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(100% 80% at 50% 0%, rgba(255, 121, 189, 0.18), transparent 58%),
    #07091a;
}

.site-unlocked .site-gate { display: none !important; }

.site-gate-card {
  width: min(92vw, 390px);
  padding: 36px 28px 30px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), transparent 42%),
    #0d1230;
  box-shadow: var(--shadow-deep), 0 0 44px rgba(255, 121, 189, 0.16);
  text-align: center;
}

.site-gate-kicker {
  margin: 0 0 6px;
  color: var(--c-secondary);
  font-family: var(--font-num);
  font-size: 0.76rem;
  letter-spacing: 0.32em;
}

.site-gate-title {
  margin: 0 0 8px;
  color: #fff;
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-shadow: 0 0 24px rgba(255, 121, 189, 0.34);
}

.site-gate-lead {
  margin: 0 0 22px;
  color: var(--c-text-dim);
  font-size: 0.95rem;
}

.site-gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.site-gate-input {
  width: 100%;
  min-height: 48px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--c-text);
  font-size: 1rem;
  text-align: center;
}

.site-gate-input:focus {
  border-color: rgba(255, 121, 189, 0.72);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 121, 189, 0.16);
}

.site-gate-btn {
  width: 100%;
  min-height: 48px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 195, 222, 0.42);
  border-radius: 6px;
  background: linear-gradient(120deg, #ff5cad, #aab8ff);
  color: #08101f;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.site-gate-btn:hover { box-shadow: 0 10px 28px rgba(255, 121, 189, 0.34); }
.site-gate-btn:disabled { cursor: default; opacity: 0.6; }

.site-gate-error {
  min-height: 1.2em;
  margin: 14px 0 0;
  color: #ffb4c8;
  font-size: 0.9rem;
}

@keyframes sparkSlash {
  0% {
    opacity: 0;
    transform: translate3d(-160%, -50%, 0) skewX(-18deg) scaleX(0.48);
  }
  12%, 64% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate3d(330%, -50%, 0) skewX(-18deg) scaleX(1.2);
  }
}

@keyframes brandStamp {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes logoReveal {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes introFade {
  0%, 66% { opacity: 1; }
  100% { opacity: 0; }
}

@media (min-width: 1024px) {
  body { font-size: 17px; }
}

@media (max-width: 760px) {
  :root { --header-h: 92px; }

  .site-header {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 9px 14px 10px;
  }

  .site-brand {
    min-height: 36px;
    font-size: 0.82rem;
  }

  .site-brand::before {
    width: 24px;
    height: 24px;
  }

  .site-nav {
    justify-content: flex-start;
    margin-inline: -14px;
    padding-inline: 40px 14px;
    scroll-padding-inline: 40px 14px;
  }

  .site-nav-wrap::before,
  .site-nav-wrap::after {
    width: 24px;
  }

  .sec-label-ja {
    font-size: clamp(1.42rem, 7.4vw, 2rem);
  }
}

@media (max-width: 420px) {
  .section {
    padding-right: 16px;
    padding-left: 16px;
  }

  .cta-button {
    width: 100%;
    padding-right: 20px;
    padding-left: 20px;
  }

  .intro-brand {
    font-size: clamp(2.8rem, 17vw, 4.6rem);
    letter-spacing: 0.12em;
    padding-left: 0.12em;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .cursor-glow,
  .intro-overlay {
    display: none !important;
  }
}
