/* ============ 852wa.com — kawaii errorcore / vaporwave ============ */
:root {
  --bg: #f2f2f4;              /* 方眼紙ホワイト */
  --paper: #ffffff;
  --fg: #26262b;
  --dim: #9094a0;
  --line: #d8dae0;
  --pink: #ff7ad9;
  --lav: #b28dff;
  --cyan: #6ee8ff;
  --mint: #9dffd8;
  --accent: #17b6e0;          /* メイン差し色(水色) */
  --accent-dim: rgba(23, 182, 224, .08);
  --holo: linear-gradient(100deg, #7de3ff, #a5ecec 35%, #d3f4c9 65%, #fdf3b3 100%);
  --win-bar: linear-gradient(90deg, #7de3ff, #fdf3b3);
  --mono: "Courier New", "Osaka-Mono", "MS Gothic", monospace;
  --sans: "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  overflow-x: hidden;
  line-height: 1.85;
  /* 方眼紙 */
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
}
/* パステルの光だまり */
body::before {
  content: "";
  position: fixed; inset: -20%;
  z-index: -2;
  background:
    radial-gradient(40% 32% at 15% 15%, rgba(125,227,255,.13), transparent 70%),
    radial-gradient(44% 38% at 85% 25%, rgba(253,243,179,.16), transparent 70%),
    radial-gradient(36% 30% at 25% 85%, rgba(165,236,236,.12), transparent 70%),
    radial-gradient(42% 36% at 80% 82%, rgba(211,244,201,.12), transparent 70%);
  pointer-events: none;
}
::selection { background: var(--accent); color: #fff; }

/* ---------- nav: ホロ下線付きウィンドウバー ---------- */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 2rem;
  padding: .9rem 2rem;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
  font-family: var(--mono);
}
nav::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
  background: var(--holo);
}
nav .logo {
  font-size: 1rem; letter-spacing: .22em;
  color: var(--fg); text-decoration: none;
  font-weight: bold;
}
nav .logo::before { content: "■ "; color: var(--accent); }
nav .links { display: flex; gap: 1.5rem; margin-left: auto; flex-wrap: wrap; }
nav .links a {
  color: var(--dim); text-decoration: none;
  font-size: .78rem; letter-spacing: .16em;
  text-transform: uppercase;
  position: relative;
  transition: color .25s;
}
nav .links a:hover { color: var(--accent); }
nav .links a.active { color: var(--accent); }
nav .links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 0; height: 2px; background: var(--holo);
  transition: width .3s;
}
nav .links a:hover::after, nav .links a.active::after { width: 100%; }

main { max-width: 1080px; margin: 0 auto; padding: 8rem 1.5rem 5rem; position: relative; z-index: 1; }

/* ---------- hero ---------- */
.hero { min-height: 58vh; display: flex; flex-direction: column; justify-content: center; position: relative; }
/* 白黒チェッカー(missing texture)ステッカー */
.hero::before {
  content: "";
  position: absolute; inset: 16% 46% 22% -1.5rem;
  background: conic-gradient(#26262b 0 25%, transparent 0 50%, #26262b 0 75%, transparent 0) 0 0/22px 22px;
  opacity: .08;
  transform: rotate(-3deg);
  z-index: -1;
}
/* タイトル: ホログラフィックグラデ文字 */
.glitch {
  font-family: var(--mono);
  font-size: clamp(2.4rem, 8.5vw, 5.5rem);
  font-weight: bold; letter-spacing: .05em;
  display: inline-block;
  background: linear-gradient(95deg, #17b6e0, #6fd6c3 40%, #cfc36a 75%, #e4b83c 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(38,38,43,.16)) drop-shadow(0 0 18px rgba(125,227,255,.45));
}
.glitch::after {
  content: "▌";
  background: none; -webkit-background-clip: initial; background-clip: initial;
  color: var(--accent);
  animation: blink 1.2s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero .sub {
  font-family: var(--mono);
  color: var(--dim);
  margin-top: 1.2rem;
  letter-spacing: .26em;
  font-size: .84rem;
}
.hero .sub::before { content: "○ "; color: var(--accent); }
.hero .sub .cursor { color: var(--accent); animation: blink 1.2s steps(1) infinite; }

/* ---------- sections ---------- */
section { margin: 6rem 0; }
h2 {
  font-family: var(--mono);
  font-size: .88rem; letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--fg);
  margin-bottom: 2.2rem;
  display: flex; align-items: center; gap: 1rem;
  font-weight: bold;
}
h2::before {
  content: "";
  width: 14px; height: 14px; flex: none;
  background: conic-gradient(#26262b 0 25%, #fff 0 50%, #26262b 0 75%, #fff 0) 0 0/7px 7px;
  border: 1px solid var(--fg);
}
h2::after { content: ""; flex: 1; height: 3px; background: var(--holo); opacity: .5; border-radius: 2px; }

html.js .reveal { opacity: 0; transform: translateY(24px); filter: blur(3px); transition: opacity .8s ease, transform .8s ease, filter .8s ease; }
html.js .reveal.on { opacity: 1; transform: none; filter: none; }

/* ---------- cards: Win95ウィンドウ風 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  background: none; border: none;
}
.card {
  background: var(--paper);
  padding: 2.6rem 1.4rem 2.2rem;
  text-decoration: none; color: var(--fg);
  position: relative; overflow: hidden;
  display: block;
  border: 1px solid var(--fg);
  box-shadow: 4px 4px 0 rgba(38,38,43,.85);
  transition: transform .2s, box-shadow .2s;
}
/* ウィンドウのタイトルバー */
.card::before {
  content: "· · ·";
  position: absolute; top: 0; left: 0; right: 0;
  height: 1.5rem; line-height: 1.1rem;
  background: var(--win-bar);
  color: #26262b; font-family: var(--mono); font-weight: bold;
  text-align: right; padding-right: .5rem;
  border-bottom: 1px solid var(--fg);
  letter-spacing: .1em;
}
/* 閉じるボタン(飾り) */
.card::after {
  content: "×";
  position: absolute; top: 3px; right: 5px;
  width: 15px; height: 15px; line-height: 13px;
  background: #fff; color: var(--fg);
  border: 1px solid var(--fg);
  font-family: var(--mono); font-size: .7rem; text-align: center;
}
.card:hover { transform: translate(-2px, -2px) rotate(-.4deg); box-shadow: 7px 7px 0 rgba(125,227,255,.85); }
.card .num { font-family: var(--mono); font-size: .66rem; color: var(--dim); letter-spacing: .2em; }
.card .num::before { content: "err_"; color: var(--accent); }
.card .t { font-size: 1.08rem; font-weight: bold; margin: .5rem 0 .35rem; display: inline-block; }
.card:hover .t {
  background: var(--holo);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.card .d { font-size: .82rem; color: var(--dim); display: block; }
.card .arrow {
  position: absolute; right: 1.2rem; bottom: .9rem;
  font-family: var(--mono); color: var(--dim);
  transition: transform .25s, color .25s;
}
.card:hover .arrow { transform: translateX(6px); color: var(--accent); }
.card .tag {
  display: inline-block; font-family: var(--mono);
  font-size: .6rem; letter-spacing: .16em;
  border: 1px dashed var(--accent); color: var(--accent);
  padding: .12rem .55rem; margin-top: .85rem;
  background: rgba(125,227,255,.08);
}

/* ---------- link list: 付箋シール風 ---------- */
.linklist { display: flex; flex-direction: column; gap: 8px; background: none; border: none; }
.linklist a {
  display: flex; align-items: baseline; gap: 1rem;
  background: var(--paper); color: var(--fg);
  text-decoration: none; padding: .95rem 1.4rem;
  border: 1px solid var(--fg);
  box-shadow: 3px 3px 0 rgba(38,38,43,.85);
  transition: transform .18s, box-shadow .18s;
}
.linklist a:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 rgba(125,227,255,.85); }
.linklist a:nth-child(odd):hover { box-shadow: 5px 5px 0 rgba(253,243,179,.95); }
.linklist .name { font-weight: bold; min-width: 9.5em; }
.linklist .note { color: var(--dim); font-size: .82rem; }
.linklist .ext { margin-left: auto; font-family: var(--mono); color: var(--accent); font-size: .8rem; }

/* ---------- profile ---------- */
.profile p { color: #4a4d55; max-width: 620px; margin-bottom: 1rem; }
.profile .mail, .mail {
  font-family: var(--mono); color: var(--accent) !important;
  border-bottom: 1px dashed var(--accent);
  text-decoration: none;
}
.profile .mail:hover, .mail:hover { background: var(--accent); color: #fff !important; }

/* ---------- footer: NO SIGNAL ---------- */
footer {
  background: #26262b;
  color: #fff;
  padding: 2.2rem 1.5rem;
  text-align: center;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .3em;
  position: relative;
}
footer::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--holo);
}
footer::after {
  content: " □ NO SIGNAL";
  background: var(--holo);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- モザイク帯 (JS挿入) ---------- */
.mosaic-strip { display: flex; height: 10px; margin-top: 2.4rem; overflow: hidden; border: 1px solid var(--fg); }
.mosaic-strip i { flex: 1; }

/* ---------- Win95風エラーウィンドウ(パステル化) ---------- */
.win-dialog {
  position: fixed; right: 18px; bottom: 18px; z-index: 1000;
  width: min(300px, 84vw);
  background: #fff;
  border: 1px solid var(--fg);
  box-shadow: 5px 5px 0 rgba(38,38,43,.85);
  font-family: var(--mono); font-size: .75rem; color: var(--fg);
}
.win-dialog .bar {
  display: flex; align-items: center; gap: .5rem;
  background: var(--win-bar); color: #26262b;
  padding: .3rem .55rem; font-weight: bold; letter-spacing: .05em;
  border-bottom: 1px solid var(--fg);
}
.win-dialog .bar .x {
  margin-left: auto; background: #fff; color: var(--fg);
  border: 1px solid var(--fg);
  width: 16px; height: 16px; line-height: 14px; text-align: center;
  cursor: pointer; font-size: .7rem;
}
.win-dialog .bar .x:hover { background: var(--accent); color: #fff; }
.win-dialog .body { display: flex; gap: .7rem; padding: .9rem .8rem .5rem; align-items: flex-start; }
.win-dialog .icon { font-size: 1.4rem; line-height: 1; }
.win-dialog .msg { line-height: 1.5; }
.win-dialog .btns { text-align: center; padding: .4rem 0 .7rem; }
.win-dialog button.ok {
  background: #fff; color: var(--fg); font-family: var(--mono); font-size: .72rem;
  border: 1px solid var(--fg);
  box-shadow: 2px 2px 0 rgba(38,38,43,.85);
  padding: .2rem 1.6rem; cursor: pointer;
}
.win-dialog button.ok:hover { background: var(--mint); }
.win-dialog button.ok:active { box-shadow: none; transform: translate(2px,2px); }

/* ---------- 浮遊ステッカー (JS挿入・邪魔しない) ---------- */
.sticker {
  position: fixed; z-index: -1;
  font-family: var(--mono);
  user-select: none; pointer-events: none;
  opacity: .5;
  animation: floaty 9s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(var(--rot, -4deg)); }
  50% { transform: translateY(-14px) rotate(var(--rot, -4deg)); }
}
.sticker.chip {
  background: #fff; border: 1px solid var(--fg);
  box-shadow: 3px 3px 0 rgba(38,38,43,.6);
  font-size: .66rem; letter-spacing: .12em;
  padding: .2rem .7rem;
  opacity: .85; z-index: 0;
}

/* ---------- 折りたたみ ---------- */
details.fold summary { list-style: none; cursor: pointer; outline: none; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary h2 { margin-bottom: 0; transition: color .25s; }
details.fold summary:hover h2 { color: var(--accent); }
details.fold summary h2 { gap: .8rem; }
details.fold summary h2::before { content: "[+]"; width: auto; height: auto; background: none; border: none; color: var(--accent); letter-spacing: 0; font-weight: bold; }
details.fold[open] summary h2::before { content: "[-]"; }
details.fold[open] summary { margin-bottom: 2.2rem; }

@media (max-width: 640px) {
  nav { padding: .8rem 1rem; gap: 1rem; }
  nav .links { gap: .8rem; }
  .linklist .name { min-width: auto; }
  .linklist .ext { display: none; }
  .sticker { display: none; }
}

/* ---------- カードのサムネイル ---------- */
.card .thumb {
  display: block; width: 100%; height: auto;
  aspect-ratio: 16 / 9; object-fit: cover;
  border: 1px solid var(--fg);
  margin: .7rem 0 .5rem;
  background: conic-gradient(#e8e8ec 0 25%, #fff 0 50%, #e8e8ec 0 75%, #fff 0) 0 0/14px 14px;
}

/* status バッジ(全ページ共通) */
.status { display:inline-block; font-family:var(--mono); font-size:.62rem; letter-spacing:.15em;
  padding:.1rem .5rem; margin-left:.5rem; border:1px solid var(--line); color:var(--dim); vertical-align:middle; }
.status.on { border-color:var(--fg); color:var(--fg); }

/* ---------- カード整列: flex化(タイトル折返し対応・statusは最下部) ---------- */
.card { display: flex; flex-direction: column; align-items: flex-start; }
.card .t { display: block; word-break: break-word; line-height: 1.5; }
.card .d { margin-bottom: .2rem; }
.card .links { margin-top: auto; padding-top: .6rem; }
.card .status { order: 99; margin: .7rem 0 0; }
.card .thumb { align-self: stretch; }
.card .tag { order: 98; }

/* タイトル微調整: 長いタイトルでも崩れないように */
.card .t {
  font-size: .92rem;
  letter-spacing: .02em;
  overflow-wrap: anywhere;   /* 英語の長い連続文字列も強制折返し */
  max-width: 100%;
}
