/* Lexica — PIN gate and landing page. */

/* ================= PIN gate ================= */
.gate-page { display: grid; min-height: 100vh; min-height: 100dvh; }
.gate-branch {
  position: fixed; top: 0; right: 0;
  width: min(980px, 82vw); height: min(640px, 64vw);
  pointer-events: none; z-index: 0;
}
.gate-letters {
  position: fixed; top: clamp(28px, 6vh, 64px); left: clamp(20px, 5vw, 72px);
  font-size: clamp(18px, 2.2vw, 28px); z-index: 0;
}
.gate {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 48px 16px;
}
.gate__card {
  width: min(380px, 100%);
  padding: 32px 28px 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.gate__brand { display: flex; align-items: center; justify-content: center; gap: 12px; }
.gate__brand h1 { margin: 0; font: 600 34px/1 var(--font-display); letter-spacing: 0.06em; }
.gate__lead { margin: 12px 0 20px; color: var(--ink-2); font-size: 14px; }
.gate-nav {
  position: fixed; top: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 4px;
  padding: 18px clamp(16px, 4vw, 48px);
}
.site-nav { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 480px) {
  .site-nav .btn { width: 32px; padding: 0; }
  .site-nav__label { display: none; }
}

.gate__foot { margin: 0; color: var(--ink-3); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; }

.pin-input {
  position: absolute; opacity: 0; pointer-events: none;
  width: 1px; height: 1px; left: 50%; top: 0;
}
.pin-boxes { display: flex; justify-content: center; gap: 10px; cursor: text; }
.pin-boxes span {
  width: 40px; height: 50px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--card);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.pin-boxes span.is-filled::after {
  content: ''; width: 12px; height: 12px; border-radius: 50%;
  background: var(--sakura-deep);
  animation: lx-pop .18s ease-out;
}
.pin-boxes.is-focused span.is-current { border-color: var(--sakura); box-shadow: var(--focus); }
.pin-boxes.is-error span { border-color: var(--error); background: var(--error-bg); }
.pin-boxes.is-error { animation: lx-shake .42s; }
.pin-boxes.is-busy span.is-filled::after { animation: lx-pulse 1s infinite; }
.pin-boxes.is-locked span { background: var(--paper-2); }
@keyframes lx-pop { from { transform: scale(.3); } }
@keyframes lx-pulse { 50% { opacity: .35; } }
@keyframes lx-shake {
  15%, 55% { transform: translateX(-7px); }
  35%, 75% { transform: translateX(7px); }
  90% { transform: translateX(-2px); }
}
.pin-msg { min-height: 21px; margin: 12px 0 6px; font-size: 13px; color: var(--error-ink); }
.pin-msg.is-info { color: var(--ink-2); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.keypad button {
  height: 52px; border: 1px solid transparent; border-radius: 14px;
  background: var(--paper-2); cursor: pointer;
  font: 500 21px/1 var(--font-display);
  transition: background .12s, border-color .12s, transform .08s;
  display: grid; place-items: center;
}
.keypad button:hover { background: var(--sakura-pale); border-color: var(--accent-line); }
.keypad button:active { transform: scale(.97); }
.keypad button:disabled { opacity: .45; cursor: not-allowed; }
.keypad .keypad__fn { font: 500 13px/1 var(--font-ui); color: var(--ink-2); background: transparent; }
.keypad .keypad__fn svg { width: 22px; height: 22px; }

/* ================= Landing ================= */
.home-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 48px);
}
.home-top__brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font: 600 19px/1 var(--font-display); letter-spacing: 0.08em;
}
.home-top__actions { display: inline-flex; align-items: center; gap: 4px; }
/* The hero artwork runs under the header; a glass pill keeps the buttons readable over it. */
.home-top__actions .btn--ghost, .gate-nav .btn--ghost { background: var(--glass); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.home-top__actions .btn--ghost:hover, .gate-nav .btn--ghost:hover { background: var(--sakura-pale); }
.home-top__brand .seal { width: 28px; height: 28px; font-size: 13px; }

.hero {
  position: relative;
  min-height: min(760px, 100vh);
  padding: 120px clamp(16px, 5vw, 72px) 56px;
  display: grid; grid-template-columns: auto 1fr; align-items: end; gap: clamp(24px, 5vw, 72px);
}
.hero__branch {
  position: absolute; top: 0; right: 0;
  width: min(1000px, 66vw); height: min(640px, 42vw);
  pointer-events: none;
}
.hero__letters { align-self: start; font-size: clamp(18px, 2.3vw, 30px); padding-top: 4px; }
.hero__text { position: relative; z-index: 2; max-width: 520px; padding-bottom: 8px; }
.hero__eyebrow { margin: 0 0 10px; font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--sakura-deep); }
.hero__title { margin: 0; font: 600 clamp(56px, 9vw, 112px)/0.95 var(--font-display); letter-spacing: 0.04em; }
.hero__lead { margin: 18px 0 0; max-width: 440px; color: var(--ink-2); font-size: 16px; }

.collection { padding: 8px clamp(16px, 5vw, 72px) 72px; max-width: 1240px; }
.collection__head {
  display: flex; align-items: baseline; gap: 14px;
  padding-bottom: 14px; margin-bottom: 22px; border-bottom: 1px solid var(--line);
}
.collection__head h2 { margin: 0; font: 600 24px/1.2 var(--font-display); }
.collection__count { color: var(--ink-3); font-size: 13px; }

.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.app-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 268px; padding: 24px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--card); color: var(--ink); text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
a.app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent-line); }
.app-card__no { font: 500 12px/1 var(--font-ui); letter-spacing: 0.2em; color: var(--ink-3); }
.app-card__kanji {
  position: absolute; right: 14px; top: 2px;
  font: 600 108px/1 var(--font-display); color: var(--sakura-pale);
  transition: color .2s;
}
a.app-card:hover .app-card__kanji { color: var(--accent-soft); }
.app-card__name { position: relative; margin: 26px 0 0; font: 600 25px/1.2 var(--font-display); }
.app-card__desc { position: relative; margin: 0; color: var(--ink-2); font-size: 14px; }
.app-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.app-card__tags span { padding: 3px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); font-size: 12px; }
.app-card__open {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--sakura-ink); font-weight: 500; font-size: 14px;
}
.app-card__open svg { width: 16px; height: 16px; transition: transform .2s; }
a.app-card:hover .app-card__open svg { transform: translateX(4px); }
.app-card--soon { background: transparent; border-style: dashed; border-color: var(--line-2); box-shadow: none; }
.app-card--soon .app-card__name { color: var(--ink-3); }
.app-card--soon .app-card__desc { color: var(--ink-3); }
.app-card--soon .app-card__kanji { color: var(--ghost-kanji); }

.home-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  padding: 22px clamp(16px, 5vw, 72px) 32px;
  border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: 12px; letter-spacing: 0.08em;
}

@media (max-width: 760px) {
  .gate-branch { width: 100vw; height: 62vw; }
  .gate-letters { top: 20px; left: 16px; font-size: 15px; gap: 10px; }
  .gate { padding-top: 46vw; }
  .gate__card { padding: 26px 20px 20px; }
  .pin-boxes { gap: 8px; }
  .pin-boxes span { width: 38px; height: 46px; }

  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 74vw; gap: 18px; }
  .hero__branch { width: 100vw; height: 70vw; top: 40px; }
  .hero__letters { position: absolute; top: 76px; left: 16px; font-size: 15px; gap: 10px; }
  .app-grid { grid-template-columns: 1fr; }
}
