/* ========================================
   theme-terminal.css
   黒×phosphor緑のターミナルUI（純粋）。
   ======================================== */

/* --- 全体下地 ---------------------- */
html { background: #020a1a; }
body { background: transparent; }   /* canvas を透過させる */

/* 背景アニメ用 canvas（crypto-flow.js が描画） */
#bg-flow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* --- ヘッダー ----------------------------- */
.site-header {
  background: linear-gradient(to bottom, rgba(2, 10, 26, 0.92), rgba(2, 10, 26, 0.7));
  border-bottom: 1px solid var(--phosphor-dim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.site-header__brand {
  color: var(--phosphor-bright);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-shadow: 0 0 8px var(--phosphor-shadow);
}
.site-header__brand::before {
  content: "$ ";
  color: var(--phosphor);
  margin-right: 0.2em;
}
.brand-name { color: var(--phosphor-bright); }
.brand-mark { display: none; }

.site-nav__list a {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  position: relative;
  padding: 0.3em 0;
}
.site-nav__list a::before {
  content: ".";
  color: var(--phosphor);
  margin-right: 0.3em;
  opacity: 0.7;
}
.site-nav__list a:hover,
.site-nav__list a:focus-visible {
  color: var(--phosphor-bright);
  text-shadow: 0 0 8px var(--phosphor-shadow);
}

.lang-switch {
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  color: var(--ink-dim);
}
.lang-switch a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.2em 0.4em;
}
.lang-switch a[aria-current="true"] {
  color: var(--phosphor);
  font-weight: 600;
}

/* --- ヒーロー ----------------------------- */
.hero {
  background: transparent;  /* 背景は #bg-flow に任せる */
  color: var(--ink);
  position: relative;
  overflow: hidden;
}

.hero__title {
  margin: 0 0 var(--sp-lg);
  display: flex;
  justify-content: center;
}
.hero__logo {
  width: clamp(220px, 50vw, 480px);
  height: auto;
  filter:
    drop-shadow(0 0 24px var(--phosphor-shadow))
    drop-shadow(0 0 80px rgba(51, 255, 102, 0.2));
}
.hero__logo--fallback {
  color: var(--phosphor-bright);
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hero__lead { color: var(--ink); font-family: var(--font-mono); }
.hero__lead :lang(ja) { font-family: var(--font-mono), var(--font-jp-mono); }
.hero__sub { color: var(--ink-soft); }

.hero__cta {
  color: var(--bg);
  background: var(--phosphor);
  border: 1px solid var(--phosphor-bright);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.7em 1.4em;
  text-decoration: none;
  display: inline-flex;
  gap: 0.5em;
  box-shadow:
    0 0 0 1px var(--phosphor-dim),
    0 0 24px var(--phosphor-shadow);
  transition: transform var(--t-fast) var(--easing), box-shadow var(--t-base) var(--easing);
}
.hero__cta::before { content: "$ "; opacity: 0.7; }
.hero__cta:hover,
.hero__cta:focus-visible {
  color: var(--bg);
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px var(--phosphor-bright),
    0 0 32px var(--phosphor-shadow);
}

/* --- セクション余白 ----------------------- */
.section {
  position: relative;
  padding: var(--sp-xl) 0;
}

/* --- ターミナルウィンドウ UI -------------- */
.term {
  background: var(--bg-card);
  border: 1px solid var(--phosphor-dim);
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(51, 255, 102, 0.06),
    0 12px 48px rgba(0, 0, 0, 0.6),
    inset 0 0 60px rgba(51, 255, 102, 0.03);
}

.term__bar {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 0.55em 1em;
  background: linear-gradient(to bottom, #14201a 0%, #0a120c 100%);
  border-bottom: 1px solid var(--phosphor-dim);
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  color: var(--ink-dim);
}
.term__dots {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
}
.term__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink-dim);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}
.term__dot--r { background: var(--crimson); }
.term__dot--y { background: var(--amber); }
.term__dot--g { background: var(--phosphor); }
.term__title {
  flex: 1;
  text-align: center;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.term__badge {
  font-size: var(--fs-tiny);
  color: var(--phosphor-dim);
  letter-spacing: 0.1em;
}

.term__body {
  padding: 1.4em 1.6em 1.8em;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  line-height: var(--lh-mono);
  color: var(--ink);
}

/* プロンプト（コマンド入力行） */
.prompt {
  display: block;
  color: var(--ink-soft);
  margin: 0 0 0.4em;
  font-family: var(--font-mono);
  word-break: break-all;
}
.prompt::before {
  content: "satokan@cipher:~$ ";
  color: var(--phosphor-bright);
  white-space: pre;
}

.prompt .path {
  color: var(--cyan);
}
.prompt .cmd {
  color: var(--phosphor-bright);
  font-weight: 600;
}
.prompt .arg {
  color: var(--amber);
}
.prompt .flag {
  color: var(--magenta);
}

/* コマンド出力 */
.output {
  margin: 0 0 1.6em;
  color: var(--ink);
}
.output > h2,
.output > h3 {
  font-family: var(--font-mono);
  color: var(--phosphor-bright);
  margin-bottom: 0.6em;
  text-shadow: 0 0 12px var(--phosphor-shadow);
}
.output > h2 { font-size: var(--fs-h2); }
.output > p { margin: 0 0 0.8em; }
.output > p:last-child { margin-bottom: 0; }
.output a { color: var(--phosphor); }
.output strong { color: var(--phosphor-bright); font-weight: 600; }

/* 所属 dl */
.affiliation { margin: 0 0 0.8em; }
.affiliation dt { color: var(--phosphor-dim); font-size: 0.85em; margin-bottom: 0.2em; }
.affiliation dd { margin: 0 0 0.2em 1em; }

/* ls -l 風のリスト表示 */
.fslist {
  list-style: none;
  padding: 0;
  margin: 0 0 1em;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink);
}
.fslist__head {
  color: var(--ink-dim);
  border-bottom: 1px dashed var(--phosphor-dim);
  padding-bottom: 0.4em;
  margin-bottom: 0.6em;
  display: grid;
  grid-template-columns: 6ch 8ch 1fr 12ch;
  gap: 1em;
}
.fslist__row {
  display: grid;
  grid-template-columns: 6ch 8ch 1fr 12ch;
  gap: 1em;
  padding: 0.4em 0;
  border-bottom: 1px dotted rgba(51, 255, 102, 0.12);
  align-items: baseline;
}
.fslist__row:last-child { border-bottom: none; }
.fslist__perm { color: var(--phosphor-dim); }
.fslist__size { color: var(--ink-dim); text-align: right; }
.fslist__date { color: var(--ink-soft); }
.fslist__name {
  color: var(--phosphor-bright);
  text-decoration: none;
}
.fslist__name:hover {
  color: var(--phosphor);
  text-shadow: 0 0 8px var(--phosphor-shadow);
}
.fslist__name--exec::after { content: "*"; color: var(--phosphor); }
.fslist__meta {
  grid-column: 1 / -1;
  font-size: 0.85em;
  color: var(--ink-soft);
  margin-top: 0.2em;
  white-space: normal;
  font-family: var(--font-mono), var(--font-jp-mono);
}

@media (max-width: 720px) {
  .fslist__head,
  .fslist__row {
    grid-template-columns: 1fr;
    gap: 0.2em;
  }
  .fslist__perm,
  .fslist__size,
  .fslist__date { display: none; }
  .fslist__head { display: none; }
}

/* タグ（key=value 風） */
.taglist {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-md);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 0.8em;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.taglist li {
  color: var(--phosphor);
}
.taglist li::before { content: "+ "; color: var(--phosphor-dim); }

/* SNS — 設定ファイル風（key = "value"） */
.sns-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}
.sns-list > li { padding: 0.35em 0; }
.sns-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  text-decoration: none;
  color: var(--phosphor);
  transition: color var(--t-fast) var(--easing), text-shadow var(--t-fast) var(--easing);
}
.sns-link::before {
  content: attr(data-sns) " = ";
  color: var(--ink-soft);
  font-weight: 400;
}
.sns-link:hover,
.sns-link:focus-visible {
  color: var(--phosphor-bright);
  text-shadow: 0 0 8px var(--phosphor-shadow);
}
.sns-link__icon {
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--icon, none) center / contain no-repeat;
          mask: var(--icon, none) center / contain no-repeat;
  flex-shrink: 0;
}
.sns-link__icon[data-icon="github"]   { --icon: url("/assets/svg/icon-github.svg"); }
.sns-link__icon[data-icon="x"]        { --icon: url("/assets/svg/icon-x.svg"); }
.sns-link__icon[data-icon="bluesky"]  { --icon: url("/assets/svg/icon-bluesky.svg"); }
.sns-link__icon[data-icon="mastodon"] { --icon: url("/assets/svg/icon-mastodon.svg"); }
.sns-link__icon[data-icon="note"]     { --icon: url("/assets/svg/icon-note.svg"); }
.sns-link__icon[data-icon="zenn"]     { --icon: url("/assets/svg/icon-zenn.svg"); }
.sns-link__icon[data-icon="linkedin"] { --icon: url("/assets/svg/icon-linkedin.svg"); }
.sns-link__label {
  color: var(--phosphor-bright);
  text-decoration: underline;
  text-decoration-color: rgba(51, 255, 102, 0.3);
  text-underline-offset: 0.3em;
}
.sns-link__label::before { content: '"'; color: var(--ink-dim); }
.sns-link__label::after  { content: '"'; color: var(--ink-dim); }

/* ブリンキングカーソル */
.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  background: var(--phosphor);
  vertical-align: text-bottom;
  margin-left: 2px;
  box-shadow: 0 0 6px var(--phosphor-shadow);
  animation: cursor-blink 1.05s steps(2) infinite;
}
@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* セクションヘッダ用 紋章は小さく金で残す */
.section__kamon {
  display: none;
}

/* タイトルは見出しタグだけ。出力ブロックの中で生きる */
.section__title,
.section__subtitle,
.section__header {
  display: contents;
}

/* --- フッター ----------------------------- */
.site-footer {
  background:
    linear-gradient(to bottom, var(--bg-soft) 0%, var(--bg) 100%);
  color: var(--ink-soft);
  border-top: 1px solid var(--phosphor-dim);
  padding: var(--sp-lg) 0 var(--sp-md);
}
.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-sm);
  text-align: center;
}
.site-footer__copy {
  font-size: var(--fs-tiny);
  color: var(--ink-dim);
  font-family: var(--font-mono);
  margin: 0;
}
.site-footer .lang-switch a { color: var(--ink-dim); }
.site-footer .lang-switch a[aria-current="true"] { color: var(--phosphor); }

/* フッターの実 TLS 表示 */
.site-footer__cipher {
  margin: 0;
  font-size: var(--fs-tiny);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  flex-wrap: wrap;
  justify-content: center;
  font-family: var(--font-mono);
}
.site-footer__cipher-label {
  color: var(--bg);
  background: var(--phosphor);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.65rem;
  padding: 0.2em 0.55em;
  border-radius: 2px;
  font-weight: 600;
}
.site-footer__cipher-text {
  color: var(--phosphor-bright);
  text-shadow: 0 0 6px var(--phosphor-shadow);
  word-break: break-all;
}

/* --- スクロールフェード -------------------- */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--t-slow) var(--easing), transform var(--t-slow) var(--easing);
}
.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; transition: none; }
}

