:root {
  --bg: #0b0d14;
  --bg-card: #141826;
  --text: #e6e8ef;
  --muted: #9aa1b5;
  --accent: #f3e3b0;
  --line: #262b3d;
  --radius: 14px;
  --max: 1080px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f5f1;
    --bg-card: #ffffff;
    --text: #1b1d24;
    --muted: #5d6273;
    --accent: #8a6d1d;
    --line: #e2e0d8;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* 画面全体にうっすらノイズを乗せる（noisy） */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .06;
  z-index: 10;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 20px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
}

.logo {
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
}

.site-header nav { display: flex; gap: 20px; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.site-header nav a:hover { color: var(--text); }

main { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.hero {
  position: relative;
  padding: 120px 0 100px;
}

.moon {
  position: absolute;
  right: 4%;
  top: 60px;
  width: clamp(120px, 22vw, 240px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8dc, var(--accent) 55%, #b89a4a);
  box-shadow: 0 0 80px color-mix(in srgb, var(--accent) 45%, transparent);
  opacity: .9;
  z-index: -1;
}

.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.6rem);
  line-height: 1.35;
  margin: 0 0 24px;
}

.lead { color: var(--muted); max-width: 36em; font-size: 1.05rem; }

.section { padding: 72px 0; border-top: 1px solid var(--line); }
.section h2 {
  font-size: .9rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 32px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }

/* サムネ画像を用意したら background-image: url(...) に差し替える */
.card-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, hsl(var(--hue) 45% 35%), hsl(calc(var(--hue) + 40) 45% 18%));
  background-size: cover;
  background-position: center;
}

.card-body { padding: 20px; }
.card-body h3 { margin: 0 0 8px; font-size: 1.1rem; }
.card-body p { margin: 0 0 12px; color: var(--muted); font-size: .95rem; }

.tags { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font-size: .75rem;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.more { font-size: .9rem; color: var(--accent); text-decoration: none; }

.about { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .about { grid-template-columns: 1.2fr 1fr; } }
.about p { margin: 0; }

.skills { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; }
.skills dt { color: var(--muted); font-size: .85rem; }
.skills dd { margin: 0; }

.links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 16px; }
.links a {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
}
.links a:hover { border-color: var(--accent); color: var(--accent); }

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: .85rem;
  border-top: 1px solid var(--line);
}

/* 下層ページ（privacy など）用 */
.page { max-width: 760px; margin: 0 auto; padding: 60px 20px; }
.page h1 { font-size: 1.8rem; }
.page h2 { font-size: 1.15rem; margin-top: 2.2em; }
.page table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.page th, .page td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
}
