:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-alt: #f0efe9;
  --text: #2d2d2d;
  --text-muted: #767676;
  --accent: #4a7c6f;
  --accent-hover: #3a6559;
  --accent-light: #e8f0ee;
  --border: #e2e1da;
  --radius: 8px;
  --max-w: 920px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable; /* スクロールバー有無によるレイアウトずれ防止 */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ── Nav ─────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(247,246,243,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.logo {
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text);
  margin-right: auto;
  letter-spacing: -0.01em;
}
.logo:hover { color: var(--accent); text-decoration: none; }
.nav-links {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  align-items: center;
}
.nav-links a {
  font-size: 1rem;
  color: var(--text-muted);
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-cta {
  background: var(--accent) !important;
  color: #fff !important;
  padding: 0.4rem 1.1rem;
  border-radius: 4px;
  transition: background 0.2s !important;
}
.nav-cta:hover { background: var(--accent-hover) !important; }
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text);
  padding: 0.25rem;
}

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.2s;
  cursor: pointer;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-ghost:hover { background: var(--accent-light); }

/* ── Sections ───────────────────────────── */
.section { padding: 4.5rem 1.5rem; }
.section-alt { background: var(--surface-alt); }
.container { max-width: var(--max-w); margin: 0 auto; }

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.section-title::after {
  content: '';
  display: block;
  width: 2rem;
  height: 2px;
  background: var(--accent);
  margin-top: 0.4rem;
  margin-bottom: 2rem;
}
.section-note { color: var(--text-muted); font-size: 0.9rem; }

/* ── Hero ────────────────────────────────── */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 5.5rem 1.5rem 4.5rem;
  text-align: center;
}
.hero-inner { max-width: 700px; margin: 0 auto; }
.hero-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}
.hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2.25rem;
  line-height: 1.8;
}
.hero-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ── Cards ───────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.07); }
.card-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
.card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.card p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.7; }

/* ── Works ───────────────────────────────── */
.works-placeholder {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ── About ───────────────────────────────── */
.about-grid {
  display: flex;
  column-gap: 2rem;
  row-gap: 3rem;
  align-items: flex-start;
}
.about-text p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}
.about-neil { margin-top: 1rem; }
.about-neil a { font-weight: 600; }
.about-photo {
  width: 180px;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
}
.img-placeholder {
  width: 180px;
  height: 220px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  gap: 0.25rem;
}

/* ── Contact ─────────────────────────────── */
.contact-inner { text-align: center; max-width: 520px; margin: 0 auto; }
.contact-inner .section-title::after { margin-left: auto; margin-right: auto; }
.contact-inner p { color: var(--text-muted); margin-bottom: 1.75rem; }

/* ── Footer ──────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 2px solid var(--border);
  padding: 1.75rem 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.site-footer .container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
}
.site-footer .container > *:last-child {
  text-align: right;
  justify-self: end;
}

/* ── Neil page ───────────────────────────── */
.neil-header {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.neil-header h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem; }
.neil-header p { color: var(--text-muted); font-size: 0.9rem; }
.neil-photo {
  max-width: 400px;
  width: 100%;
  border-radius: var(--radius);
  margin: 1.75rem auto 0;
  display: block;
  border: 1px solid var(--border);
}
.neil-section { padding: 3rem 1.5rem; }
.neil-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.neil-table th, .neil-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.neil-table th {
  width: 140px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}
.neil-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.neil-gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ── Page header (apps / diary) ─────────── */
.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 1.5rem 2rem;
}
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-title::after {
  content: '';
  display: block;
  width: 2rem;
  height: 2px;
  background: var(--accent);
  margin-top: 0.4rem;
  margin-bottom: 0.25rem;
}
.page-sub { color: var(--text-muted); font-size: 0.9rem; }

/* ── Apps grid (index preview) ───────────── */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.app-thumb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}
.app-thumb-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.app-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.app-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.app-thumb-body {
  padding: 1rem 1.125rem 1.125rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.4rem;
}
.app-thumb-name { font-weight: 700; font-size: 0.95rem; }
.app-thumb-comment { font-size: 0.85rem; color: var(--text-muted); flex: 1; line-height: 1.6; }
.app-thumb-link { font-size: 0.8rem; padding: 0.35rem 0.85rem; align-self: flex-start; margin-top: 0.25rem; }
.app-thumb-soon { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ── App log list (apps.html) ────────────── */
.app-list { display: flex; flex-direction: column; gap: 0; }
.app-log-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.app-log-card:first-child { border-top: 1px solid var(--border); }
.app-log-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.1rem;
}
.app-log-date { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.app-log-body { display: flex; flex-direction: column; gap: 0.4rem; }
.app-log-head { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.app-log-appname { font-weight: 700; font-size: 0.95rem; }
.app-log-title { font-size: 0.875rem; color: var(--text-muted); }
.app-log-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.7; }
.app-link { font-size: 0.8rem; padding: 0.35rem 0.85rem; align-self: flex-start; margin-top: 0.25rem; }

.badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.badge-release { background: #e6f4ea; color: #2d7a3a; }
.badge-update  { background: var(--accent-light); color: var(--accent); }
.badge-platform { background: var(--surface-alt); color: var(--text-muted); }
.badge-soon { background: #fdf3e3; color: #a06500; }

/* ── Diary list ──────────────────────────── */
.diary-list { display: flex; flex-direction: column; gap: 2rem; }
.diary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.diary-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.25rem 1.5rem 0.75rem;
  flex-wrap: wrap;
}
.diary-title { font-size: 1rem; font-weight: 700; }
.diary-date { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.diary-media {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
  background: var(--surface-alt);
}
video.diary-media { max-height: 360px; background: #000; }
.diary-text {
  padding: 1rem 1.5rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ── SNS link ────────────────────────────── */
.sns-links { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.sns-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.2s, color 0.2s;
}
.sns-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.sns-link--instagram:hover { border-color: #e1306c; color: #e1306c; }
.sns-link--kofi { }
.sns-link--kofi:hover { border-color: #ff5e5b; color: #ff5e5b; }

/* ── Privacy ─────────────────────────────── */
.privacy-body {
  max-width: 640px;
}
.privacy-intro {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.9rem;
}
.privacy-body h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
  color: var(--text);
}
.privacy-body p, .privacy-body ul {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.8;
}
.privacy-body ul {
  padding-left: 1.25rem;
}
.privacy-body li { margin-bottom: 0.2rem; }
.privacy-date {
  margin-top: 2.5rem;
  font-size: 0.8rem;
  color: var(--border);
}

/* ── Footer policy link ──────────────────── */
.footer-policy {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer-policy:hover { color: var(--text); text-decoration: none; }

/* ── Common ──────────────────────────────── */
.loading-text, .empty-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 3rem 0;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 640px) {
  .menu-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0.85rem;
    align-items: flex-start;
  }
  .nav-links.open { display: flex; }
  .nav-cta { display: inline-block; }
  .about-grid { flex-direction: column; row-gap: 1.5rem; }
  .img-placeholder { width: 100%; height: 160px; }
  .about-photo { width: 100%; height: 200px; }
  .neil-table th { width: 110px; }
  .app-log-card { grid-template-columns: 1fr; gap: 0.4rem; }
  .app-log-meta { flex-direction: row; flex-wrap: wrap; align-items: center; }
}
