/* ========== Base & Theme ========== */
:root{
  --bg: #0b0f14;
  --card: #111824;
  --text: #e6eef8;
  --muted: #93a4b8;
  --accent: #5aa9ff;
  --ring: #8ab6ff;
  --shadow: 0 4px 12px rgba(0,0,0,.35);
  --gap: clamp(12px, 2.2vw, 20px);
}

@media (prefers-color-scheme: light){
  :root{
    --bg: #f7fafc;
    --card: #ffffff;
    --text: #0e1726;
    --muted: #586b84;
    --accent: #2563eb;
    --ring: #3b82f6;
    --shadow: 0 4px 10px rgba(0,0,0,.15);
  }
}

*{ box-sizing: border-box; }
html, body { font-size: 18px; }
body{
  margin: 0;
  font-family: "Oswald", "Roboto Condensed", "Noto Sans JP", sans-serif;
  line-height: 1.6;
  letter-spacing: .03em;
  color: var(--text);
  background: var(--bg); /* 単色のみ */
  padding: clamp(16px, 3vw, 28px);
  display: grid;
  place-items: start center;
}

/* ========== Page Title ========== */
h1{
  width: min(960px, 100%);
  margin: 0 0 14px;
  font-size: clamp(32px, 5vw, 50px);
  font-weight: 900;
  color: #ffffff;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 6px;
}

/* ========== Section Title ========== */
h2{
  width: min(960px, 100%);
  margin: 30px auto 0;
  font-size: clamp(20px, 2.6vw, 24px);
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  border-left: 4px solid var(--accent);
  padding-left: 8px;
}

/* ========== Section Card (h2 + ul) ========== */
h2 + ul{
  width: min(960px, 100%);
  margin: 12px auto 0;
  padding: clamp(16px, 2.2vw, 20px);
  list-style: none;
  background: var(--card);
  border: 2px solid rgba(255,255,255,.1);
  border-radius: 0;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap);
}

/* 「その他」の下の<ul>の下に余白を追加 */
ul:last-of-type {
  margin-bottom: 30px;
}

/* ========== Link Cards ========== */
li{ margin: 0; padding: 0; }

a{
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255,255,255,.03);
  border: 2px solid rgba(255,255,255,.12);
  border-radius: 0;
  padding: 16px 18px;
  font-size: 1.05em;
  font-weight: 600;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
  min-height: 52px;
}

/* テキストを囲む<span>にのみ適用 */
a > span {
  white-space: nowrap; 
  overflow: hidden;    
  text-overflow: ellipsis;
  flex-grow: 1; /* テキストが可能な限りスペースを占有するように */
}

a:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.06);
  border-color: var(--accent);
}

a:active{ transform: translateY(0); }

/* External link arrow */
a::after{
  content: "↗";
  margin-left: auto;
  opacity: .6;
  font-size: 15px;
}

/* Icon bubble → 四角化 */
a::before{
  content: "🔗";
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: rgba(90,169,255,.15);
  border: 2px solid rgba(90,169,255,.5);
  font-size: 18px;
}

/* ========== Domain-based Icons (emoji) ========== */
a[href*="instagram.com"]::before { content:"📸"; }
a[href*="migdal.jp"]::before { content:"🧭"; }
a[href*="note.com"]::before { content:"📝"; }
a[href*="qiita.com"]::before { content:"💻"; }
a[href*="jp.quora.com"]::before { content:"🅠"; }
a[href*="reddit.com"]::before { content:"👽"; }
a[href*="kakuyomu.jp"]::before { content:"📚"; }
a[href*="syosetu.com"]::before { content:"✒️"; }
a[href*="tiktok.com"]::before { content:"🎵"; }
a[href*="youtube.com"]::before { content:"▶️"; }
a[href*="nicovideo.jp"]::before { content:"🎞️"; }
a[href*="bsky.app"]::before { content:"🪽"; }
a[href*="misskey.io"]::before { content:"🌱"; }
a[href*="threads"]::before { content:"🧵"; }
a[href*="x.com"]::before { content:"❌"; }
a[href*="github.com"]::before { content:"🐙"; }
a[href*="ziphil.com"]::before { content:"🔤"; }
a[href*="novelgame.jp"]::before { content:"🎮"; }
a[href*="facebook.com"]::before { content:"📘"; }

/* ========== Focus & Accessibility ========== */
a:focus-visible{
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

/* ========== Small screens fine-tuning ========== */
@media (max-width: 420px){
  html, body { font-size: 16px; }
  a{ padding: 14px 16px; min-height: 46px; }
  h2 + ul{ gap: 12px; }
}

/* Optional: selection color */
::selection{
  background: rgba(90,169,255,.4);
  color: white;
}
