/* ==========================================================================
   HALU 統合ポータル  style.css  v1.20
   黒 × シアン（UI） × グリーン（地球・稼働）
   ========================================================================== */

:root {
  --void:     #02050A;
  --line:     #0F2233;
  --line-lit: #1B4462;
  --text:     #C6DCEC;
  --dim:      #56778F;

  --cyan:     #37D2F0;
  --cyan-dim: rgba(55, 210, 240, 0.16);
  --cyan-glow:rgba(55, 210, 240, 0.45);

  --green:    #38EB96;
  --down:     #FF4E6B;

  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "Yu Gothic UI", "Hiragino Sans",
          "Noto Sans JP", "Meiryo", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  position: relative;
  background: var(--void);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;

  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    radial-gradient(120% 64% at 50% -10%, #082031 0%, var(--void) 62%);
  background-size: 52px 52px, 52px 52px, 100% 100%;
  background-position: center top;
}

body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(88% 54% at 50% 44%,
              rgba(2, 5, 10, 0.34) 0%, rgba(2, 5, 10, 0.95) 78%);
}

body::after {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 60;
  background: repeating-linear-gradient(to bottom,
    rgba(55, 210, 240, 0.026) 0px, rgba(55, 210, 240, 0.026) 1px,
    transparent 1px, transparent 3px);
}

.shell {
  position: relative; z-index: 2;
  max-width: 660px; margin: 0 auto; padding: 0 20px 56px;
}

a { color: inherit; }

/* ==========================================================================
   ロゴ
   ========================================================================== */

.wordmark {
  position: relative;
  display: inline-block;
  padding: 14px 26px 12px;
}

.wordmark-text {
  position: relative;
  display: inline-block;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0.30em;
  text-indent: 0.30em;
  color: #EAF8FF;
  text-shadow:
    0 0 2px rgba(255, 255, 255, 0.55),
    0 0 14px var(--cyan-glow),
    0 0 40px rgba(55, 210, 240, 0.32);
}

/* 色ズレ（極薄）。これで平坦な文字に厚みが出る */
.wordmark-text::before,
.wordmark-text::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  letter-spacing: inherit;
  text-indent: inherit;
  pointer-events: none;
}

.wordmark-text::before { color: rgba(55, 210, 240, 0.55); transform: translateX(-1.5px); text-shadow: none; }
.wordmark-text::after  { color: rgba(56, 235, 150, 0.34); transform: translateX(1.5px);  text-shadow: none; }

/* 四隅の鉤括弧 */
.wordmark-frame { position: absolute; inset: 0; pointer-events: none; }

.wordmark-frame::before,
.wordmark-frame::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border: 1px solid var(--cyan);
  opacity: 0.75;
}

.wordmark-frame::before { top: 0; left: 0;      border-right: none; border-bottom: none; }
.wordmark-frame::after  { bottom: 0; right: 0;  border-left: none;  border-top: none; }

.wordmark-lg .wordmark-text { font-size: 56px; }

.wordmark-sm { padding: 0; }
.wordmark-sm .wordmark-text {
  font-size: 15px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-shadow: 0 0 10px rgba(55, 210, 240, 0.4);
}
.wordmark-sm .wordmark-text::before,
.wordmark-sm .wordmark-text::after { display: none; }

/* ==========================================================================
   起動演出
   ========================================================================== */

.boot {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: var(--void);
  cursor: pointer;
  transition: opacity .6s ease, transform .6s ease;
}

.boot-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.boot-center { position: relative; text-align: center; }

.boot-status {
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--green);
  text-shadow: 0 0 12px rgba(56, 235, 150, 0.5);
}

.boot-skip {
  position: absolute; bottom: 26px; left: 0; right: 0;
  margin: 0; text-align: center;
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.24em; color: var(--dim); opacity: .55;
}

.boot-out { opacity: 0; transform: scale(1.16); pointer-events: none; }

/* メニュー本体は演出のあとに出る */
.stage { opacity: 0; }
.stage-in { animation: stage-in .5s ease forwards; }

@keyframes stage-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.stage-in .rail {
  opacity: 0;
  animation: rail-in .42s ease forwards;
  animation-delay: calc(0.16s + var(--i, 0) * 0.07s);
}

@keyframes rail-in {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: none; }
}

/* ==========================================================================
   ログイン
   ========================================================================== */

.bg-globe {
  position: fixed; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: .8;
}

.gate { max-width: 348px; margin: 0 auto; padding-top: 11vh; text-align: center; }

.gate-sub {
  margin: 14px 0 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
}

.err-code {
  font-family: var(--mono); font-size: 48px; margin: 26px 0 4px;
  color: var(--line-lit); text-shadow: 0 0 20px rgba(27, 68, 98, 0.7);
}

.gate-form {
  position: relative;
  margin-top: 34px;
  padding: 26px 22px 22px;
  text-align: left;
  background: linear-gradient(180deg, rgba(8, 20, 32, 0.86), rgba(2, 6, 12, 0.88));
  border: 1px solid var(--line-lit);
  border-radius: 2px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6),
              inset 0 0 40px rgba(55, 210, 240, 0.04);
  backdrop-filter: blur(2px);
}

.field { display: block; margin-bottom: 18px; }

.field-label {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 8px;
}

.field-label::before { content: "[ "; }
.field-label::after  { content: " ]"; }

.field input {
  width: 100%;
  padding: 11px 13px;
  background: rgba(2, 5, 10, 0.8);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.06em;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--cyan);
  background: rgba(8, 22, 36, 0.9);
  box-shadow: 0 0 0 1px var(--cyan-dim), 0 0 18px rgba(55, 210, 240, 0.18);
}

.check {
  display: flex; align-items: center; gap: 9px;
  margin: 2px 0 24px; color: var(--dim); font-size: 12px; cursor: pointer;
}

.check input { accent-color: var(--cyan); width: 15px; height: 15px; }

.btn {
  display: block; width: 100%; padding: 12px;
  background: linear-gradient(180deg, rgba(55, 210, 240, 0.16), rgba(55, 210, 240, 0.05));
  color: var(--cyan);
  border: 1px solid var(--cyan);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.4em; text-indent: 0.4em;
  cursor: pointer;
  transition: background .18s ease, box-shadow .18s ease, color .18s ease;
}

.btn:hover { background: var(--cyan); color: #01070B; box-shadow: 0 0 26px var(--cyan-glow); }
.btn:active { box-shadow: none; }

.btn-ghost {
  display: inline-block; width: auto; margin-top: 28px; padding: 10px 26px;
  background: transparent; color: var(--dim);
  border-color: var(--line-lit); letter-spacing: 0.2em; text-indent: 0.2em;
  text-decoration: none;
}

.btn-ghost:hover {
  background: transparent; color: var(--cyan);
  border-color: var(--cyan); box-shadow: 0 0 18px rgba(55, 210, 240, 0.22);
}

.alert {
  margin-top: 24px; padding: 11px 14px;
  border: 1px solid var(--down); border-left-width: 2px; border-radius: 2px;
  background: rgba(255, 78, 107, 0.08); color: #FF9BAC;
  font-size: 12.5px; text-align: left;
  box-shadow: 0 0 20px rgba(255, 78, 107, 0.12);
}

/* ==========================================================================
   メニュー
   ========================================================================== */

.bar {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 28px 0 20px;
  border-bottom: 1px solid var(--line-lit);
  margin-bottom: 28px;
}

.bar::after {
  content: "";
  position: absolute; left: 0; bottom: -1px;
  width: 28%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: sweep 7s ease-in-out infinite;
}

@keyframes sweep {
  0%, 100% { transform: translateX(-8%);  opacity: .2; }
  50%      { transform: translateX(266%); opacity: .9; }
}

.bar-left, .bar-right {
  display: flex; align-items: baseline; gap: 14px; min-width: 0;
}

.host, .who {
  font-family: var(--mono); font-size: 10.5px;
  color: var(--dim); letter-spacing: 0.08em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.who::before { content: "\25B8 "; color: var(--line-lit); }

.link-quiet {
  background: none; border: none; padding: 0;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em;
  color: var(--dim); text-decoration: none; cursor: pointer;
  transition: color .16s ease, text-shadow .16s ease;
}

.link-quiet:hover { color: var(--cyan); text-shadow: 0 0 12px var(--cyan-glow); }

.rack { display: flex; flex-direction: column; gap: 9px; }

.rail {
  position: relative;
  display: grid;
  grid-template-columns: 62px 12px 1fr auto;
  align-items: center; gap: 14px;
  padding: 17px 18px;
  background: linear-gradient(100deg, rgba(9, 22, 35, 0.72), rgba(3, 8, 15, 0.72));
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-lit);
  border-radius: 2px;
  text-decoration: none;
  overflow: hidden;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.rail::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--cyan-dim), transparent 46%);
  opacity: 0; transition: opacity .22s ease; pointer-events: none;
}

a.rail:hover {
  border-color: var(--line-lit);
  border-left-color: var(--cyan);
  transform: translateX(3px);
  box-shadow: -6px 0 24px rgba(55, 210, 240, 0.14);
}

a.rail:hover::before { opacity: 1; }

a.rail:focus-visible {
  outline: 1px solid var(--cyan); outline-offset: 2px;
  box-shadow: 0 0 20px rgba(55, 210, 240, 0.24);
}

.rail-off { opacity: .32; }

a.rail.rail-down { cursor: not-allowed; }

a.rail.rail-down:hover {
  border-left-color: var(--down); transform: none;
  box-shadow: -6px 0 22px rgba(255, 78, 107, 0.13);
}

a.rail.rail-down:hover::before {
  opacity: 1;
  background: linear-gradient(90deg, rgba(255, 78, 107, 0.13), transparent 46%);
}

.rail-key {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.18em; color: var(--line-lit);
  text-transform: uppercase; transition: color .18s ease;
}

a.rail:hover .rail-key { color: var(--cyan); }

.rail-text { min-width: 0; }

.rail-name { display: block; font-size: 15px; font-weight: 600; letter-spacing: .02em; }

.rail-desc {
  display: block; font-size: 11.5px; color: var(--dim); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.rail-state {
  font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.18em; color: var(--dim); white-space: nowrap;
}

/* --- ランプ --------------------------------------------------------- */

.lamp { width: 8px; height: 8px; border-radius: 50%; background: var(--line-lit); justify-self: center; }

.lamp-up { background: var(--green); animation: pulse-up 2.8s ease-in-out infinite; }
.lamp-down { background: var(--down); box-shadow: 0 0 9px rgba(255, 78, 107, .72); }
.lamp-off, .lamp-unknown { background: var(--line-lit); box-shadow: none; }

@keyframes pulse-up {
  0%, 100% { box-shadow: 0 0 7px rgba(56, 235, 150, .55), 0 0 0 0 rgba(56, 235, 150, .30); }
  50%      { box-shadow: 0 0 14px rgba(56, 235, 150, .95), 0 0 0 6px rgba(56, 235, 150, 0); }
}

.shake { animation: shake .3s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-3px); }
  75%      { transform: translateX(3px); }
}

.foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 26px; padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.18em; color: var(--dim);
}

.foot span::before { content: "// "; color: var(--line-lit); }

/* ==========================================================================
   狭い画面
   ========================================================================== */

@media (max-width: 460px) {
  .shell { padding: 0 14px 40px; }
  body { background-size: 38px 38px, 38px 38px, 100% 100%; }

  .wordmark-text { font-size: 30px; }
  .wordmark-lg .wordmark-text { font-size: 38px; }

  .rail { grid-template-columns: 12px 1fr auto; gap: 12px; padding: 15px 14px; }
  .rail-key { display: none; }
  .rail-state { font-size: 9px; letter-spacing: .1em; }

  .bar { flex-wrap: wrap; gap: 8px 14px; }
  .host { font-size: 10px; }
  .gate { padding-top: 7vh; }
}

/* ==========================================================================
   動きを減らす設定を尊重する
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  a.rail:hover { transform: none; }
  body::after { display: none; }
  .stage { opacity: 1; }
  .stage-in .rail { opacity: 1; }
}
