/* Entry flow: fixed night background + header; only the stage changes. */
@view-transition { navigation: auto; }

html, body.night { height: 100%; }
/* header + scrolling stage; only the stage scrolls, the background never moves */
body.night { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; overflow: hidden; font-family: var(--sans); }
body.night::before { display: none; }

.night-bg {
  position: fixed; inset: 0; z-index: -2;
  background: #080706 url("assets/hero-desktop-v4.webp") 62% center / cover no-repeat;
  view-transition-name: night-bg;
}
.night-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #050403e6 0%, #050403b3 45%, #05040366 100%), linear-gradient(0deg, #050403cc, transparent 40%); }

.night-header {
  position: relative; z-index: 5; min-height: 76px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 18px;
  padding: 10px var(--gutter); background: linear-gradient(#070605e6, #07060599);
  view-transition-name: night-header;
}
.night-header .brand-name { font-size: 30px; }

.night-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.night-links { display: flex; flex-wrap: wrap; gap: 2px 16px; list-style: none; margin: 0; padding: 0; }
.night-links a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 2px; color: #d9c8ad; font-size: 13px; letter-spacing: .08em; border-bottom: 1px solid transparent; }
.night-links a:hover { color: var(--ivory); }
.night-links a[aria-current="page"] { color: var(--ivory); border-bottom-color: var(--gold); }
.night-badge { min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--gold); color: #1d1408; font: 700 11px/18px var(--sans); text-align: center; }
.night-logout { margin: 0; }
.night-logout .login-button { padding: 7px 14px; font-size: 11px; }
.night-stage {
  position: relative; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; view-transition-name: night-stage;
}
.night-inner { max-width: 760px; margin: 0 auto; padding: 18px var(--gutter) 64px; }
.night-inner.is-wide { max-width: 1080px; }
html.is-sliding .night-stage { pointer-events: none; }

.night-back { display: inline-flex; gap: 10px; align-items: center; margin-bottom: 14px; color: var(--gold); font-size: 13px; letter-spacing: .1em; }
.night-back:hover { color: var(--ivory); }
.night-flash { margin: 0 0 16px; padding: 10px 16px; border-left: 2px solid var(--gold); background: #120e0acc; color: var(--ivory); font-size: 14px; }

.night h1, .night .flow-title { margin: 6px 0 8px; font: 400 clamp(30px, 4.4vw, 44px)/1.25 var(--serif); letter-spacing: .06em; color: var(--ivory); }
.night h1:focus { outline: none; }
.night h2 { margin: 26px 0 10px; font: 400 20px var(--serif); color: var(--gold); letter-spacing: .08em; }
.night p { line-height: 1.8; }
.night .muted, .night .hint { color: var(--muted); font-size: 13px; }
.night .field p, .night .field .hint { margin: 0; line-height: 1.6; }

/* step indicator */
.flow-steps { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 4px 0 22px; padding: 0; counter-reset: s; }
.flow-steps li { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; color: #6d665e; font-size: 12px; letter-spacing: .06em; }
.flow-steps li::after { content: ""; position: absolute; top: 13px; left: 32px; right: 4px; height: 1px; background: #3d362f; }
.flow-steps li:last-child::after { display: none; }
.flow-steps li.is-done { color: #c9a46a; }
.flow-steps li.is-done::after { background: #c9a46a; }
.flow-steps li.is-current { color: #ffdc96; }
.fs-num { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid currentColor; border-radius: 50%; font: 12px var(--sans); }
.flow-steps li.is-current .fs-num { background: #ffdc9622; box-shadow: 0 0 12px #f2b95c55; }

/* panels readable over the background */
.night-panel { position: relative; padding: clamp(20px, 3vw, 32px); background: #0b0907d9; border: 1px solid var(--line); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.night-panel + .night-panel { margin-top: 16px; }
.night-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

/* buttons */
.n-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 52px; padding: 13px 24px; border: 1px solid transparent; color: #241707; background: linear-gradient(110deg,#9d6824,#e9c58a 20%,#ffe5b1 52%,#d0a05b 86%,#976122); font: 15px var(--serif); letter-spacing: .1em; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.n-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 24px #dbac6355; }
.n-btn.ghost { background: transparent; color: var(--ivory); border-color: #b49360; }
.n-btn.ghost:hover { background: #ddba7f14; }
.n-btn[disabled], .n-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.n-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 22px; }
.n-actions .spacer { flex: 1; }

/* forms */
.night form.stack { display: grid; gap: 20px; }
.night .field { display: grid; gap: 7px; }
.night .field label, .night .field legend { color: var(--ivory); font-size: 15px; letter-spacing: .04em; }
.night .req, .night .opt { margin-left: 8px; padding: 1px 7px; font-size: 10px; letter-spacing: .1em; vertical-align: 2px; }
.night .req { background: var(--gold); color: #1d1408; }
.night .opt { border: 1px solid #8a7a63; color: #b8a789; }
.night input[type=text], .night input[type=url], .night input[type=email], .night input[type=password], .night select, .night textarea {
  width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #6f5d43; border-radius: 0;
  background: #120e0aee; color: var(--ivory); font: 16px/1.6 var(--sans);
}
.night textarea { min-height: 120px; resize: vertical; }
.night input:focus, .night select:focus, .night textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.night .field.invalid input, .night .field.invalid select, .night .field.invalid textarea { border-color: #ff9b85; border-width: 2px; }
.night .error { margin: 0; color: #ffb4a3; font-size: 14px; }
.night .error::before { content: "⚠ "; }
.night .errorbox { padding: 14px 18px; border: 1px solid #ff9b85; background: #2a100cd9; color: #ffd9cf; }
.night .errorbox a { color: #ffd9cf; text-decoration: underline; }
.night .errorbox:focus { outline: 2px solid #ff9b85; }
.night .counter { color: #8f826f; font-size: 12px; text-align: right; }
.night .check { display: flex; gap: 10px; align-items: flex-start; color: var(--ivory); }
.night .check input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: #d9b06a; }
.night dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 0; }
.night dl.kv dt { color: var(--muted); font-size: 13px; }
.night dl.kv dd { margin: 0; color: var(--ivory); overflow-wrap: anywhere; }
.night .consent-text { max-height: 220px; overflow-y: auto; padding: 14px 16px; border: 1px solid var(--line); background: #070605cc; font-size: 13px; line-height: 1.8; color: #d6c6ad; }

/* role choice: the big cards act as radio buttons */
.role-choice { display: grid; gap: 22px; max-width: 860px; margin: 6px 0 4px; border: 0; padding: 0; }
.role-choice legend { margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.role-option { position: relative; display: block; cursor: pointer; }
.role-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.role-option .role-card { width: 100%; pointer-events: none; }
/* the cards are clipped to an angled shape, so the selection glow goes on the wrapper */
.role-option:has(input:checked) { filter: drop-shadow(0 0 1.5px #ffdc96) drop-shadow(0 0 16px #f2b95c99); }
.role-option input:checked + .role-card { transform: rotate(0) translateY(-4px); }
.role-option input:focus-visible + .role-card { outline: 2px solid var(--ivory); outline-offset: 6px; clip-path: none; }
.role-option.is-closed { cursor: not-allowed; }
.role-option.is-closed .role-card { filter: saturate(.3) brightness(.65); }
.role-option .role-status { position: absolute; z-index: 3; left: 26px; bottom: 14px; margin: 0; }
.role-option .role-picked { display: none; position: absolute; z-index: 3; top: 14px; right: 18px; padding: 2px 10px; font: 12px var(--sans); letter-spacing: .1em; background: #ffdc96; color: #1d1408; }
.role-option input:checked ~ .role-picked { display: block; }

/* credentials (shown once, made for a screenshot) */
.cred { max-width: 560px; }
.cred-grid { display: grid; gap: 6px; margin: 18px 0 8px; padding: 18px; border: 1px solid var(--gold); background: #0b0907f2; }
.cred-grid dt { color: var(--muted); font-size: 12px; }
.cred-grid dd { margin: 0 0 10px; }
.cred-value { display: block; color: #ffe7b5; font: 700 clamp(17px, 5vw, 26px)/1.35 ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: .03em; overflow-wrap: anywhere; user-select: all; }
.cred-head { display: flex; gap: 12px; align-items: center; }
.cred-cat { width: 44px; height: 44px; fill: var(--gold); flex: none; }
.night .notice { padding: 12px 16px; border-left: 2px solid var(--gold); background: #1a130bcc; color: #f0dfc2; font-size: 14px; line-height: 1.8; }

/* the slide: current stage leaves to the left, the next enters from the right; reversed on back */
@keyframes ns-out-left { to { transform: translateX(-28vw); opacity: 0; } }
@keyframes ns-in-right { from { transform: translateX(28vw); opacity: 0; } }
@keyframes ns-out-right { to { transform: translateX(28vw); opacity: 0; } }
@keyframes ns-in-left { from { transform: translateX(-28vw); opacity: 0; } }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(night-header) { animation-duration: .4s; }
::view-transition-old(night-header) { display: none; }
::view-transition-new(night-header) { animation: none; }
::view-transition-group(night-bg) { animation-duration: .4s; animation-timing-function: cubic-bezier(.22,.7,.2,1); }
::view-transition-old(night-bg), ::view-transition-new(night-bg) { animation-duration: .4s; }
::view-transition-group(night-stage) { animation: none; }
::view-transition-old(night-stage) { animation: ns-out-left .4s cubic-bezier(.22,.7,.2,1) both; }
::view-transition-new(night-stage) { animation: ns-in-right .4s cubic-bezier(.22,.7,.2,1) both; }
html:active-view-transition-type(back)::view-transition-old(night-stage) { animation-name: ns-out-right; }
html:active-view-transition-type(back)::view-transition-new(night-stage) { animation-name: ns-in-left; }

@media (max-width: 760px) {
  .night-bg { background-image: url("assets/hero-mobile-v4.webp"); background-position: 70% 30%; }
  .night-bg::after { background: linear-gradient(0deg, #050403f2 0%, #050403cc 55%, #05040399 100%); }
  .night-header { min-height: 60px; padding: 8px 16px; }
  .night-nav { display: contents; }
  .night-links { width: 100%; order: 3; justify-content: space-between; gap: 0; }
  .night-logout, .night-header > .night-nav > .login-button { order: 2; }
  .night-links a { font-size: 12px; padding: 6px 0; }
  .night-header .brand-name { font-size: 25px; }
  .night-header .brand-divider, .night-header .brand-tag { display: none; }
  .night-header .login-button { gap: 10px; padding: 8px 14px; }
  .night-inner { padding: 12px 16px calc(48px + env(safe-area-inset-bottom)); }
  .flow-steps li { font-size: 10px; }
  .flow-steps li::after { left: 28px; }
  .fs-num { width: 23px; height: 23px; font-size: 11px; }
  .night dl.kv { grid-template-columns: 1fr; gap: 2px; }
  .night dl.kv dd { margin-bottom: 10px; }
  .n-actions .n-btn { flex: 1 1 100%; }
  .n-actions .spacer { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
.night-panel > h2:first-child, .night-panel > input[type=hidden] + h2, .night-panel > input[type=hidden] ~ h2:first-of-type { margin-top: 0; }
.night-panel p { margin: 0; }
.night form.night-panel.stack { gap: 16px; }

/* ---- Applicant pages (選考状況・面接予約・DM・個人情報) in the night shell ---- */
.night .eyebrow { margin: 0 0 4px; color: var(--gold); font: 11px var(--sans); letter-spacing: .3em; text-transform: uppercase; }
.night .lead { color: #d6c6ad; font-size: 15px; }
.night .small { font-size: 13px; }
.night .card { margin: 12px 0; padding: 18px 20px; background: #0b0907d9; border: 1px solid var(--line); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.night .card.strong { border-color: #b4936099; }
.night .card h3 { margin: 0 0 8px; color: var(--ivory); font: 400 17px var(--serif); letter-spacing: .05em; }
.night .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.night .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.night .between { justify-content: space-between; }
.night .stack { display: grid; gap: 14px; }
.night .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.night .plain-list { list-style: none; margin: 0; padding: 0; }
.night .w-sm { max-width: 340px; }
.night .inline { display: inline; }
.night .btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 11px 22px; border: 1px solid transparent; color: #241707; background: linear-gradient(110deg,#9d6824,#e9c58a 20%,#ffe5b1 52%,#d0a05b 86%,#976122); font: 14px var(--serif); letter-spacing: .08em; cursor: pointer; text-decoration: none; }
.night .btn.ghost { background: transparent; color: var(--ivory); border-color: #b49360; }
.night .btn.small { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.night .btn.danger { background: transparent; color: #ffb4a3; border-color: #ff9b85; }
.night .btn[disabled] { opacity: .45; cursor: not-allowed; }
.night .notice.warn { border-left-color: #e6a35c; }
.night .notice a, .night .card a:not(.btn) { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.night .timer { color: var(--ivory); font: 400 clamp(20px, 3vw, 26px)/1.3 var(--serif); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
/* status chips: shape + symbol + text, never colour alone */
.night .chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border: 1px solid currentColor; border-radius: 99px; font-size: 12px; color: #e7cfa3; white-space: nowrap; }
.night .chip::before { font-size: 10px; }
.night .chip.s-es_review::before { content: "◔"; }
.night .chip.s-interview_invited::before { content: "✉"; }
.night .chip.s-booked::before { content: "◷"; }
.night .chip.s-interviewed::before, .night .chip.s-awaiting_result::before { content: "…"; }
.night .chip.s-hired, .night .chip.ok { color: #ffdc96; } .night .chip.s-hired::before, .night .chip.ok::before { content: "✓"; }
.night .chip.s-rejected { color: #a99a86; } .night .chip.s-rejected::before { content: "—"; }
.night .chip.s-withdrawn { color: #a99a86; border-style: dashed; } .night .chip.s-withdrawn::before { content: "×"; }
.night .chip.warn { color: #f0b46c; } .night .chip.warn::before { content: "!"; }
/* interview slots */
.night .slot-day { margin: 20px 0 8px; color: var(--gold); font: 400 16px var(--serif); letter-spacing: .06em; }
.night .slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.night .slot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; background: #0b0907d9; border: 1px solid var(--line); color: var(--ivory); }
.night .slot form { margin: 0; }
/* DM */
.night .thread { display: grid; gap: 12px; margin: 16px 0; }
.night .msg { max-width: 82%; padding: 12px 16px; border: 1px solid var(--line); background: #0b0907e6; color: #eadbc2; line-height: 1.8; }
.night .msg.mine { justify-self: end; background: #2a2014e6; border-color: #b4936099; }
.night .msg.system { justify-self: center; max-width: 92%; background: #120e0acc; font-size: 13px; }
.night .msg.important { border-color: var(--gold); box-shadow: 0 0 14px #f2b95c33; }
.night .msg header { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 4px; color: #b8a789; font-size: 12px; }
.night .msg .ctx { padding: 0 6px; border: 1px solid currentColor; font-size: 11px; }
.night .compose { padding: 18px; background: #0b0907e6; border: 1px solid #b49360; }
.night .compose .to { margin: 0; color: var(--gold); font-size: 13px; letter-spacing: .08em; }
/* main recruiter card */
.night .recruiter { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: #0b0907d9; border: 1px solid var(--line); color: var(--ivory); }
.night .recruiter .cat { width: 36px; height: 36px; fill: var(--gold); flex: none; }
.night .recruiter a { color: var(--gold); }
.night ul { padding-left: 1.2em; }
@media (max-width: 760px) {
  .night .msg { max-width: 94%; }
  .night .actions .btn { flex: 1 1 auto; }
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.night .journey-mini .journey-steps { gap: 14px; }
.night .journey-mini .step-number { font-size: 28px; }
.night .journey-mini .step-name { font-size: 12px; }
@media (max-width: 760px) { .night .journey-mini .step-number { font-size: 22px; } .night .journey-mini .step-name { font-size: 10px; } }

/* Admin preview of applicant pages: a fixed note; the page itself is inert. */
.preview-bar { position: fixed; z-index: 50; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; width: max-content; max-width: calc(100% - 24px); padding: 9px 16px; border: 1px solid #e7c78c; border-radius: 99px; background: #0b0907ee; color: #f3e6cf; font: 12px/1.5 var(--sans); box-shadow: 0 8px 26px #000a; }
.preview-bar b { color: #e7c78c; letter-spacing: .12em; }
.preview-bar a { color: #fff0d8; text-decoration: underline; }

/* booked interview: the main interviewer's VRChat URL wraps on phones */
.interviewer-contact a { overflow-wrap: anywhere; }
/* booking calendar: month grid, days with slots are gold links */
.night .book-cal { padding: 16px; background: #0b0907d9; border: 1px solid var(--line); }
.night .book-cal-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-bottom: 10px; }
.night .book-cal-head h2 { margin: 0; color: var(--ivory); font: 400 20px var(--serif); letter-spacing: .08em; text-align: center; }
.night .book-cal-head > :last-child { justify-self: end; }
.night .book-cal table { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.night .book-cal th { color: var(--muted); font: 400 12px var(--sans); padding: 2px 0; }
.night .book-cal th:first-child { color: #d99a8a; } .night .book-cal th:last-child { color: #9fb4d6; }
.night .cal-day { display: grid; place-items: center; min-height: 48px; padding: 4px 0; color: #6f6556; font: 400 15px var(--serif); text-decoration: none; border: 1px solid transparent; }
.night .cal-day small { font: 400 10px var(--sans); letter-spacing: .02em; }
.night .cal-day.has-slots { color: var(--ivory); border-color: var(--line); background: #2a2014cc; }
.night .cal-day.has-slots small { color: var(--gold); }
.night .cal-day.has-slots:hover, .night .cal-day.has-slots:focus-visible { border-color: var(--gold); }
.night .cal-day.is-picked { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.night .cal-day.is-picked small { color: var(--ink); }
@media (max-width: 480px) {
  .night .book-cal { padding: 10px 6px; }
  .night .book-cal table { border-spacing: 2px; }
  .night .cal-day { min-height: 42px; font-size: 14px; }
}
/* 募集条件 on the registration form */
.night .conditions { display: grid; gap: 10px; margin: 0; padding: 14px 16px; border: 1px solid var(--line); background: #2a201466; }
.night .conditions legend { padding: 0 6px; color: var(--gold); font: 400 16px var(--serif); letter-spacing: .08em; }
.night .conditions .hint { margin: 0; }
