:root {
  color-scheme: light;
  --page: #FFFFFF;
  --surface: #F7F7F8;
  --text: #333333;
  --muted: #666666;
  --line: #E5E5E5;
  --accent: #39C5BB;
  --content-width: 1080px;
  font-family: "Noto Sans JP", "Yu Gothic", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
}

a { color: inherit; }

.site-header { background: var(--page); border-bottom: 1px solid var(--line); }

.header-inner,
main,
.footer-inner {
  width: min(var(--content-width), calc(100% - 48px));
  margin-inline: auto;
}

.header-inner { padding: 18px 0 12px; }

.site-name {
  display: inline-block;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.4;
  text-decoration: none;
}

.site-nav { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 12px; }

.site-nav a,
.text-link {
  color: var(--accent);
  font-size: 16px;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.site-nav a[aria-current="page"] { color: var(--text); font-weight: 700; text-decoration: none; }

.header-rule { height: 2px; margin-top: 14px; background: var(--accent); }

main { padding: 48px 0 72px; }

.intro,
.page-panel {
  padding: 32px 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

h1, h2, h3, p { margin: 0; }

h1 { font-size: 28px; font-weight: 700; letter-spacing: .02em; line-height: 1.45; }

.intro-copy { max-width: 660px; margin-top: 10px; color: var(--muted); }

.motion-section { margin-top: 48px; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

h2 { font-size: 20px; font-weight: 700; line-height: 1.5; }
.result-count { color: var(--muted); font-size: 14px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 24px; }

.filter-button {
  min-height: 42px;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--page);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.filter-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--page);
  font-weight: 700;
}

.filter-button:focus-visible,
.action:focus-visible,
.site-name:focus-visible,
.site-nav a:focus-visible,
.text-link:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.motion-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

.motion-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--page);
}

.thumbnail {
  display: grid;
  aspect-ratio: 16 / 9;
  place-items: center;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  text-align: center;
}

.thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-text { padding: 20px; }

.thumbnail-title { font-size: 20px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.card-content { padding: 20px; }
h3 { min-height: 3em; font-size: 16px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }

.category {
  display: inline-block;
  margin-top: 10px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.file-label { margin-top: 12px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.file-name { display: block; margin-top: 2px; color: var(--text); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }

.action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.action-primary { border-color: var(--accent); background: var(--accent); color: var(--page); }
.empty-state { padding: 32px; border: 1px solid var(--line); color: var(--muted); text-align: center; }
[hidden] { display: none !important; }

.text-page { max-width: 880px; }
.terms-intro { margin-top: 20px; }
.terms-list { display: grid; gap: 12px; margin: 20px 0 0; padding-left: 1.4em; }
.terms-list li { padding-left: 4px; }

.profile-list { margin: 20px 0 0; }
.profile-row { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 18px 0; border-top: 1px solid var(--line); }
.profile-row dt { font-weight: 700; }
.profile-row dd { margin: 0; }
.profile-row dd p { margin-bottom: 8px; }

footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; padding: 22px 0 28px; color: var(--muted); font-size: 14px; }

@media (max-width: 800px) {
  .motion-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding-top: 36px; }
}

@media (max-width: 560px) {
  .header-inner, main, .footer-inner { width: min(var(--content-width), calc(100% - 32px)); }
  .header-inner { padding-top: 16px; }
  .site-name { font-size: 18px; }
  .site-nav { gap: 16px; }
  main { padding-top: 24px; padding-bottom: 48px; }
  .intro, .page-panel { padding: 24px 20px; }
  h1 { font-size: 24px; }
  .motion-section { margin-top: 36px; }
  .section-heading { align-items: start; flex-direction: column; gap: 4px; }
  .filters { gap: 8px; margin-top: 16px; }
  .filter-button { padding-inline: 13px; }
  .motion-grid { grid-template-columns: 1fr; gap: 16px; }
  .card-content { padding: 18px; }
  h3 { min-height: 0; }
  .profile-row { grid-template-columns: 1fr; gap: 4px; }
  .footer-inner { flex-direction: column; gap: 2px; }
}
