/* ---------------------------------------------------------------------------
   首页 / 落地页 (public/login.html)。

   配色、字体栈、圆角、和纸纤维都在 tokens.css，全站共用；login.html 里
   tokens.css 排在这一份前面。这里只写这一页自己的东西：两栏的落地布局、
   立绘台、砂纹圆盘，以及这一页特有的打光。 */

html, body {
  margin: 0;
  min-height: 100%;
  /* body 用 flex 撑满，.main 吃掉剩下的高度。不用 min-height: calc()：
     那个算式要把顶栏和上下内边距都数进去，漏一项就多出一条几十像素的
     滚动条——一个只能滚 30px 的落地页比能滚的更难看。 */
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.7 var(--gothic);
  -webkit-font-smoothing: antialiased;
}

/* 这一页自己的打光：一层暖光把视线压到中间偏右，也就是立绘所在。
   纸的纤维在 tokens.css 的 body::after，全站一样；这一层只有首页有，
   所以 z-index 比它再低一档。 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(70% 60% at 72% 30%, var(--paper-2), transparent 70%),
    radial-gradient(50% 50% at 12% 88%, var(--paper-3), transparent 75%);
}


/* --------------------------------------------------------------------- 顶栏 */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  /* 顶栏永远压在装饰上面。
     砂紋圆盘（.disc）是绝对定位的，而且在 DOM 里排在顶栏后面——窗口一矮，
     圆盘直径就超过画框高度，从上沿溢出去，正好盖住右上角的语言开关。
     它比顶栏晚绘制，不给顶栏一个 z-index 的话赢的是装饰。
     装饰盖住能点的东西，任何时候都是错的。 */
  position: relative;
  z-index: 2;
  /* width 不能省：body 是 flex 容器，子项上的 `margin: 0 auto` 会让它按
     内容宽度收窄再居中，而不是先撑满再被 max-width 截住。 */
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px clamp(20px, 4vw, 48px) 0;
}

.brand {
  display: flex;
  /* 印和字组之间是居中对齐，字组内部才是 baseline —— 一个方块没有基线可对，
     按 baseline 排会把它吊在「あのね」的下缘上。 */
  align-items: center;
  gap: 10px;
}

/* 印。mask 而不是 <img>：外部 SVG 的颜色改不动，而这一枚要跟着 --ink 走，
   深浅两套主题共用一份文件。字形已经轮廓化（Noto Serif JP / OFL），
   所以任何平台上都是同一个形，不会掉回别的明朝体。 */
.brand-seal {
  flex: none;
  width: 26px;
  height: 26px;
  background: var(--ink);
  -webkit-mask: url("/brand/anone-mark-mono.svg") no-repeat center / contain;
  mask: url("/brand/anone-mark-mono.svg") no-repeat center / contain;
}

.brand-word {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand-mark {
  font-family: var(--mincho);
  font-size: 21px;
  letter-spacing: 0.14em;
  font-weight: 500;
}

.brand-kana {
  font-size: 10px;
  letter-spacing: 0.34em;
  color: var(--ink-3);
  white-space: nowrap;
}

/* 语言开关。做成一个方框里两格而不是两个独立按钮：这是同一件事的两个
   状态，不是两个动作。

   选中的底色画在**按钮自己**身上，不再是一个绝对定位的滑块。滑块要靠算出来
   的宽度和位移去对齐按钮，而那个对齐只在两个按钮恰好等宽、且文字不超出格子
   时才成立——「JP」和「CN」在不同字体里字宽并不一样（J 窄，C 和 N 宽）。
   一旦错开，露在深色块外面的那半个字母就是白底白字，看起来像被挡住：
   一个语言开关认不出现在选的是哪个，比少一个滑动动效严重得多。

   底色长在按钮上就不存在「对齐」这件事——字在哪儿底色就在哪儿，任何字体、
   任何字号、任何浏览器都成立。代价是没有滑动，只有底色的淡入淡出。 */
.lang {
  display: flex;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper-2) 70%, transparent);
}

.lang button {
  /* 宽度跟着字走；min-width 只保证够点得着。 */
  min-width: 46px;
  padding: 5px 14px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--ink-3);
  font: 600 11px/1.4 var(--gothic);
  letter-spacing: 0.14em;
  /* letter-spacing 在最后一个字母后面也加一份间距，居中时整块字偏左半格。 */
  text-indent: 0.14em;
  cursor: pointer;
  transition: background-color 0.24s, color 0.24s;
}

.lang button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

/* ------------------------------------------------------------------- 主区域 */

.main {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 40px) clamp(20px, 4vw, 48px) 48px;
  flex: 1;
}

/* ------------------------------------------------------------------- 左：文案 */

/* 同上：圆盘横向也会溢出到左栏，标题和输入框不能被它盖住。 */
.intro {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  font-size: 11px;
  letter-spacing: 0.26em;
  color: var(--ink-3);
}

.eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--shu);
  flex: none;
}

.title {
  margin: 0;
  font-family: var(--mincho);
  font-weight: 500;
  font-size: clamp(32px, 4.4vw, 50px);
  line-height: 1.34;
  letter-spacing: 0.04em;
}

.title em {
  font-style: normal;
  /* 一句话里只挑一个词上朱色，其余留给墨。整页的红都在这一档预算里。 */
  color: var(--shu);
  /* 日文允许在词中间断行，窄一点的两栏里「近い」会被拆成两行的「近」和
     「い」——正好是唯一一个上了色的词，断得最显眼。 */
  white-space: nowrap;
}

.lead {
  margin: 20px 0 0;
  max-width: 30em;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.95;
}

/* --------------------------------------------------------------------- 表单 */

.gate {
  display: grid;
  gap: 10px;
  max-width: 400px;
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid var(--rule-soft);
}

.gate-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-3);
}

.gate-row { display: flex; gap: 10px; }

.gate-input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  color: var(--ink);
  /* 等宽 + 字距：8 位数字要能一眼数清输到第几位。16px 是下限，
     再小 iOS Safari 会在聚焦时整页缩放。 */
  font: 18px/1.2 var(--mono);
  letter-spacing: 0.22em;
}

.gate-input::placeholder {
  letter-spacing: normal;
  color: var(--ink-3);
  font-family: var(--gothic);
  font-size: 14px;
}

.gate-input:focus-visible {
  outline: none;
  border-color: var(--shu);
  box-shadow: 0 0 0 3px var(--shu-soft);
}

.gate-submit {
  flex: none;
  padding: 0 26px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--shu);
  color: var(--on-shu);
  font: 600 14px/1 var(--gothic);
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: filter 0.2s;
}

.gate-submit:hover { filter: brightness(1.08); }
.gate-submit:disabled { opacity: 0.5; cursor: default; }

.gate-hint {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink-3);
}

.gate-message {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.7;
}

.gate-message[data-tone="error"] { color: var(--shu); }

.disclosure {
  margin: 28px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--shu);
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-2);
}

/* --------------------------------------------------------------- 右：立绘台 */

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.stage-frame {
  position: relative;
  width: 100%;
  height: clamp(300px, calc(100dvh - 380px), 580px);
}

/* 砂紋。枯山水里绕着石头耙出来的同心圆，这里绕着人。
   用 repeating-radial-gradient 而不是贴一张图：线要细到 1px，
   任何位图在 2x 屏上都会糊成灰环。 */
.disc {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: min(94%, 460px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    repeating-radial-gradient(
      circle at 50% 50%,
      transparent 0 15px,
      var(--rule-soft) 15px 16px
    ),
    radial-gradient(circle at 50% 40%, var(--paper-2), var(--paper-3));
  box-shadow: inset 0 0 0 1px var(--rule-soft), var(--shadow);
}

/* 朱色的细环，压在砂纹外一圈。日之丸的意思，但只留轮廓——
   实心红圆会把立绘的脸抢走。 */
.disc::after {
  content: "";
  position: absolute;
  inset: -14px;
  border: 1px solid var(--shu);
  border-radius: 50%;
  opacity: 0.28;
}

.figures {
  position: absolute;
  inset: 0;
}

.figure {
  position: absolute;
  left: 50%;
  bottom: 0;
  height: 100%;
  width: auto;
  max-width: 96%;
  object-fit: contain;
  object-position: bottom center;
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, transform 0.7s ease;
  filter: drop-shadow(0 24px 30px rgba(27, 26, 23, 0.28));
  pointer-events: none;
}

.figure[data-active="true"] {
  opacity: 1;
  visibility: visible;
  animation: float 9s ease-in-out infinite;
}

/* 换人是淡入淡出加一点上浮，不是横滑：横滑会让四个人看起来是同一条
   传送带上的货，上浮更像各自站过来。 */
@keyframes float {
  from, to { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-10px); }
}

/* 暗色下深色衣服会和圆盘糊成一团——01 的黑袍几乎整个消失。落影在暗底上
   本来就不起作用，所以改成背光：把圆盘中心提亮一档，让人像靠这一点光
   立出轮廓，落影只留一层压在脚下的。 */
@media (prefers-color-scheme: dark) {
  .disc {
    background:
      repeating-radial-gradient(
        circle at 50% 50%,
        transparent 0 15px,
        var(--rule-soft) 15px 16px
      ),
      radial-gradient(circle at 50% 42%, #2e2922, #16140f 74%);
  }

  .figure { filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.7)); }
}

/* 竖排的一句。日文竖排是这一页最省力也最像日系的一处，
   中文竖排同样成立，所以切语言不用把它藏掉。 */
.tate {
  position: absolute;
  top: 4%;
  right: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 14px;
  writing-mode: vertical-rl;
  font-family: var(--mincho);
  font-size: 13px;
  letter-spacing: 0.4em;
  color: var(--ink-3);
}

.tate::before {
  content: "";
  width: 1px;
  height: 40px;
  background: var(--rule);
  flex: none;
}

/* ------------------------------------------------------------ 台下：说明与选人 */

.caption {
  margin-top: 22px;
  text-align: center;
  min-height: 92px;
}

.caption-name {
  margin: 0;
  font-family: var(--mincho);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.caption-kana {
  display: block;
  margin-top: 5px;
  font-family: var(--gothic);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-3);
}

.caption-meta {
  margin: 10px 0 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

/* 三段元信息之间用竖线分隔，间距比字距大一档，免得跟字距混成一片。 */
.caption-meta span + span::before {
  content: "／";
  margin: 0 8px;
  color: var(--rule);
}

.caption-line {
  margin: 12px 0 0;
  font-family: var(--mincho);
  font-size: 14px;
  color: var(--ink-2);
}

.roster {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.chip {
  position: relative;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--paper-3);
  overflow: hidden;
  cursor: pointer;
  filter: grayscale(0.35);
  opacity: 0.86;
  transition: filter 0.3s, opacity 0.3s, box-shadow 0.3s;
}

.chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chip:hover { filter: none; opacity: 1; }

.chip[aria-pressed="true"] {
  filter: none;
  opacity: 1;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--shu);
}

.chip:focus-visible {
  outline: 2px solid var(--shu);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------- 窄屏 */

/* 单栏之后顺序反过来：手机上先看到人，再看到字和输入框。
   立绘是这一页唯一的卖点，让它占满第一屏。 */
@media (max-width: 900px) {
  .main {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
    min-height: 0;
    padding-bottom: 40px;
  }

  .stage { order: -1; }
  .stage-frame { height: min(46dvh, 340px); }
  .disc { width: min(78%, 300px); }
  .tate { display: none; }
  .caption { min-height: 0; margin-top: 16px; }
  .caption-name { font-size: 21px; }
  .chip { width: 48px; height: 48px; }

  .title { font-size: clamp(26px, 7vw, 34px); }
  .eyebrow { margin-bottom: 16px; }
  .lead { font-size: 14px; line-height: 1.85; }
  .gate { max-width: none; margin-top: 26px; padding-top: 24px; }
  .disclosure { margin-top: 22px; }
}

/* 最窄的一档：ANONE 是装饰，让位给语言开关。印和「あのね」都留着——
   这两样加起来才是标志。 */
@media (max-width: 430px) {
  .brand-seal { width: 22px; height: 22px; }
  .brand-mark { font-size: 18px; }
  .brand-kana { display: none; }
}

@media (max-width: 380px) {
  .gate-row { flex-wrap: wrap; }
  .gate-submit { width: 100%; padding: 14px 0; }
}

/* 立绘的浮动是装饰，关掉动画偏好的人不需要它；淡入淡出留着，
   因为换人这件事本身要有反馈。 */
@media (prefers-reduced-motion: reduce) {
  .figure[data-active="true"] { animation: none; }
  .lang button { transition: none; }
}
