/* Shared, neutral styles for all pages. */
:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #666;
  --paper: #f9f9f9;
  --surface: #f2f2f2;
  --surface-hover: #e8e8e8;
  --line: #d2d2d2;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #ededed;
  --muted: #b5b5b5;
  --paper: #121212;
  --surface: #1c1c1c;
  --surface-hover: #282828;
  --line: #3b3b3b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ink: #ededed;
    --muted: #b5b5b5;
    --paper: #121212;
    --surface: #1c1c1c;
    --surface-hover: #282828;
    --line: #3b3b3b;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif; font-size: 16px; line-height: 1.85; overflow-wrap: break-word; }
a { color: inherit; text-underline-offset: 5px; }
a:focus-visible, select:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }
.site-header, main, footer { width: min(880px, calc(100% - 40px)); margin-inline: auto; }
.site-header { display: flex; align-items: center; flex-wrap: wrap; gap: 20px 28px; padding-block: 20px; border-bottom: 1px solid var(--line); }
.logo { font-size: 18px; font-weight: 700; text-decoration: none; white-space: nowrap; }
nav { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-left: auto; }
nav a { padding-block: 5px; font-size: 14px; text-decoration: none; }
nav a:hover, nav a[aria-current] { text-decoration: underline; }
.theme-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.theme-control select { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 3px; padding: 7px; min-height: 44px; }
.hero, .page-title { padding: clamp(64px, 10vw, 112px) 0 64px; border-bottom: 1px solid var(--line); }
.eyebrow, .number { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.hero > .eyebrow, .page-title > .eyebrow { margin: 0 0 24px; }
h1 { margin: 0 0 28px; font-size: clamp(34px, 5vw, 48px); font-weight: 650; line-height: 1.2; letter-spacing: -.035em; }
.page-title h1 { font-size: clamp(28px, 4vw, 36px); }
h2 { margin: 0 0 24px; font-size: clamp(21px, 2.5vw, 25px); line-height: 1.5; font-weight: 650; }
h3 { font-size: 18px; }
p { margin: 0 0 1.25em; color: var(--ink); line-break: strict; }
main p { max-width: 40em; }
.note, #contributors-status, #repo-status { color: var(--muted); font-size: 15px; line-height: 1.8; }
.note { margin-top: -8px; }
h1, h2, h3 { text-wrap: balance; }
h3 { margin-bottom: 12px; line-height: 1.5; }

.lead { max-width: 720px; font-size: 17px; margin-bottom: 12px; }
.section, .activity-section { padding: 48px 0; }
.section { border-bottom: 1px solid var(--line); }
.section > p { max-width: 720px; }
.activity-links { border-top: 1px solid var(--ink); }
.activity-links a { display: grid; grid-template-columns: minmax(160px, .45fr) 1fr; align-items: baseline; gap: 24px; padding: 26px 14px; border-bottom: 1px solid var(--line); text-decoration: none; background: transparent; transition: background-color .25s ease; }
.activity-links a:hover, .activity-links a:focus-visible { background: var(--surface-hover); }
.activity-links span { font-size: 17px; font-weight: 700; }
.activity-links span, .activity-links small { transition: transform .25s ease; }
.activity-links a:hover span, .activity-links a:hover small, .activity-links a:focus-visible span, .activity-links a:focus-visible small { transform: translateX(10px); }
.activity-links small { color: var(--muted); font-size: 15px; }
.grid { isolation: isolate; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.card { display: block; min-width: 0; padding: 28px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.card h2 { margin: 12px 0; }
.card p { margin-bottom: 0; }
.project { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.project > div { min-width: 0; }
.project h2 { overflow-wrap: anywhere; }
.button, .text-link { display: inline-block; font-size: 16px; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; padding-block: 8px; }
.project .button { flex-shrink: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tags span { font-size: 13px; padding: 2px 8px; background: var(--surface); }
.contributor img { border-radius: 50%; object-fit: cover; }
.contributor h3 { overflow-wrap: anywhere; margin: 12px 0; }
.steps { padding-left: 24px; }
.steps li { padding-left: 6px; margin-bottom: 24px; }
.steps h3, .steps p { margin: 0; }
footer { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 24px; padding: 28px 0; margin-top: 24px; }
footer p, footer > a:last-child { font-size: 14px; color: var(--muted); }
footer p { margin: 0; }
footer > a:last-child { margin-left: auto; }
.skip-link { position: absolute; top: -100px; left: 16px; background: var(--paper); padding: 8px; z-index: 20; }
.skip-link:focus { top: 8px; }
@media (max-width: 640px) {
  .site-header, main, footer { width: calc(100% - 32px); }
  .site-header { gap: 12px 20px; }
  nav { order: 3; width: 100%; margin: 0; gap: 12px 20px; }
  .theme-control { margin-left: auto; }
  .hero, .page-title { padding: 56px 0 40px; }
  .section, .activity-section { padding: 36px 0; }
  .activity-links a { grid-template-columns: 1fr; gap: 6px; padding: 20px 12px; }
  .grid { grid-template-columns: 1fr; }
  .project { flex-direction: column; align-items: flex-start; gap: 20px; }
  footer p { width: 100%; order: 3; margin: 0; }
}

/* Film navigation: the strip feeds from behind a rotating roll. */
.site-header { position: relative; z-index: 10; }
.film-menu { --film-width: 156px; --unroll-time: .85s; position: relative; margin-left: auto; width: var(--film-width); flex-shrink: 0; padding: 12px 0; isolation: isolate; z-index: 1; }
.film-menu summary { position: relative; display: grid; place-items: center; cursor: pointer; list-style: none; user-select: none; border-radius: 12px; isolation: isolate; z-index: 2; }
.film-menu summary::-webkit-details-marker { display: none; }
.film-menu summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }
.menu-reel { position: relative; display: block; width: var(--film-width); height: 54px; perspective: 600px; border-radius: 12px; background: var(--surface); box-shadow: 0 2px 4px #0002; isolation: isolate; }
.menu-reel::before, .menu-reel::after { content: ""; position: absolute; top: 0; bottom: 0; width: 8px; border: 1px solid var(--muted); border-radius: 50%; background: var(--line); z-index: 2; }
.menu-reel::before { left: -4px; }.menu-reel::after { right: -4px; }
.roll-cylinder { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform var(--unroll-time) cubic-bezier(.22,1,.36,1); }
.roll-face { position: absolute; top: 50%; left: 0; width: 100%; height: 14.5px; margin-top: -7.25px; transform: rotateX(calc(var(--face)*30deg)) translateZ(27px); backface-visibility: hidden; background: linear-gradient(to right,var(--line) 0 8%,var(--surface) 8% 92%,var(--line) 92%); border-top: 1px solid var(--line); }
.roll-face:nth-child(3n) { background: linear-gradient(to right,var(--muted) 0 8%,var(--surface-hover) 8% 92%,var(--muted) 92%); }
.reel-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 650; letter-spacing: .06em; pointer-events: none; }
.film-menu[open] .roll-cylinder { transform: rotateX(720deg); }
.film-window { position: absolute; top: 39px; left: 0; width: var(--film-width); overflow: hidden; z-index: 1; }
.film-panel { position: relative; width: 100%; padding: 52px 18px 18px; background-color: var(--surface); background-image: linear-gradient(to bottom,#0000 27px,#0003 27px,#0000 48px); background-repeat: no-repeat; color: var(--ink); border: 1px solid var(--line); }
.film-panel::before, .film-panel::after { content: ""; position: absolute; top: 0; bottom: 0; width: 5px; background: repeating-linear-gradient(to bottom,var(--paper) 0 7px,transparent 7px 13px); pointer-events: none; }
.film-panel::before { left: 4px; }.film-panel::after { right: 4px; }
.film-caption { color: var(--muted); font: 10px ui-monospace,monospace; letter-spacing: .1em; margin: 0 0 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.film-panel nav { display: flex; flex-direction: column; flex-wrap: nowrap; width: auto; margin: 0; gap: 0; counter-reset: menu-frame; }
.film-panel nav a { display: block; flex-shrink: 0; overflow-wrap: anywhere; padding: 16px 0; font-size: 14px; line-height: 1.7; border-bottom: 1px solid var(--line); text-decoration: none; }
.film-panel nav a::before { display: block; counter-increment: menu-frame; content: "FRAME / 0" counter(menu-frame); font: 10px ui-monospace,monospace; color: var(--muted); margin-bottom: 5px; }
.film-panel nav a:hover, .film-panel nav a[aria-current] { background: var(--surface-hover); }
.film-menu[open] .film-panel { animation: film-feed var(--unroll-time) cubic-bezier(.22,1,.36,1) both; }
.film-menu.is-rewinding .film-panel { animation: film-rewind var(--unroll-time) cubic-bezier(.65,0,.35,1) both; pointer-events: none; }
.film-menu.is-rewinding .roll-cylinder { transform: rotateX(0); transition-timing-function: cubic-bezier(.65,0,.35,1); }
.film-menu[open] .film-window { animation: film-shadow-in var(--unroll-time) both; }
.film-menu.is-rewinding .film-window { animation: film-shadow-out var(--unroll-time) both; }
@keyframes film-feed { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes film-rewind { from { transform: translateY(0); } to { transform: translateY(-100%); } }
@keyframes film-shadow-in { from { filter: drop-shadow(0 0 0 #0000); } to { filter: drop-shadow(0 5px 5px #0002); } }
@keyframes film-shadow-out { from { filter: drop-shadow(0 5px 5px #0002); } to { filter: drop-shadow(0 0 0 #0000); } }
@media (max-width: 640px) { .theme-control { width: 100%; justify-content: flex-end; } }
@media (prefers-reduced-motion: reduce) {
  .film-menu[open] .film-panel, .film-menu.is-rewinding .film-panel, .film-menu[open] .film-window, .film-menu.is-rewinding .film-window { animation: none; }
  .roll-cylinder { transition: none; }
}

@media (prefers-reduced-motion: reduce) { .activity-links a, .activity-links span, .activity-links small { transition: none; } .activity-links a:hover span, .activity-links a:hover small, .activity-links a:focus-visible span, .activity-links a:focus-visible small { transform: none; } }

/* Every grid row uses one separator spanning the entire content width. */
@media (min-width: 641px) {
  .grid > .card { border-bottom: 0; }
  .grid > .card:nth-child(odd) { position: relative; }
  .grid > .card:nth-child(odd)::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: calc(200% + 32px);
    z-index: 1;
    border-bottom: 1px solid var(--line);
    pointer-events: none;
  }
}

/* Keep short Japanese phrases intact while allowing narrow-screen wrapping. */
.text-phrase { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }

/* A small theme switch that follows the site's typography and colors. */
.theme-control { display:block; min-width:0; margin:0; padding:0; border:0; }
.theme-control legend { margin-bottom:6px; padding:0; font-size:12px; color:var(--muted); }
.theme-options { display:flex; padding:3px; border:1px solid var(--line); border-radius:5px; gap:2px; }
.theme-options label { position:relative; cursor:pointer; }
.theme-options input { position:absolute; width:1px; height:1px; opacity:0; }
.theme-options span { display:block; padding:8px 10px; font-size:13px; line-height:1.5; color:var(--muted); border-radius:3px; }
.theme-options input:checked + span { color:var(--ink); background:var(--surface-hover); font-weight:600; }
.theme-options label:hover span { color:var(--ink); }
.theme-options input:focus-visible + span { outline:2px solid var(--ink); outline-offset:2px; }
@media(max-width:640px) { .theme-control { width:auto; margin-left:auto; } }

/* Compact theme selector; the film control stays at the right edge. */
.site-header { gap: 16px; }
.theme-control { position: relative; width: auto; margin-left: auto; font-size: 13px; }
.theme-control summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 104px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); cursor: pointer; list-style: none; }
.theme-control summary::-webkit-details-marker { display: none; }
.theme-control summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.theme-popup { position: absolute; top: calc(100% + 8px); right: 0; z-index: 5; width: 128px; margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); box-shadow: 0 8px 20px #0002; }
.theme-popup legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.theme-options { flex-direction: column; gap: 2px; border: 0; padding: 0; }
.theme-options span { min-height: 44px; padding: 12px; }
.film-menu { margin-left: 0; --film-width: 140px; }
@media (max-width: 400px) {
  .site-header { gap: 10px; }
  .site-header > .logo { width: 100%; }
}

/* Animate inside a fixed footprint so opening never shifts the header. */
.theme-control summary { width: 108px; min-width: 0; }
.theme-control summary > [data-theme-current] { min-width: 0; }
.theme-control summary > [aria-hidden] { display: inline-block; transition: transform .18s ease; }
.theme-control[open] summary > [aria-hidden] { transform: rotate(180deg); }
.theme-popup { transform-origin: top right; }
.theme-control[open] .theme-popup { animation: theme-popup-in .18s ease-out both; }
.theme-options span { transition: background-color .15s ease, color .15s ease; }
@keyframes theme-popup-in {
  from { opacity: 0; transform: translateY(-5px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .theme-control[open] .theme-popup { animation: none; }
  .theme-control summary > [aria-hidden], .theme-options span { transition: none; }
}

/* Member colors are decorative so any chosen hue keeps the text readable. */
.contributor.has-member-color img { outline: 2px solid var(--member-color); outline-offset: 3px; }
.contributor.has-member-color h3 { display: flex; align-items: baseline; gap: 10px; }
.contributor.has-member-color h3::before { content: none; }

/* Paired member palettes follow the site's active mode without reloading. */
.contributor {
  --member-color: var(--member-accent-light, var(--ink));
  --member-title: var(--member-title-light, var(--ink));
  --member-text: var(--member-text-light, var(--muted));
  --member-background: var(--member-background-light, transparent);
}
:root[data-theme="dark"] .contributor {
  --member-color: var(--member-accent-dark, var(--ink));
  --member-title: var(--member-title-dark, var(--ink));
  --member-text: var(--member-text-dark, var(--muted));
  --member-background: var(--member-background-dark, transparent);
}
@media(prefers-color-scheme:dark) {
  :root:not([data-theme]) .contributor {
    --member-color: var(--member-accent-dark, var(--ink));
    --member-title: var(--member-title-dark, var(--ink));
    --member-text: var(--member-text-dark, var(--muted));
    --member-background: var(--member-background-dark, transparent);
  }
}
.contributor.has-member-theme { padding: 36px 0; background: transparent; }
.contributor.has-member-theme h3 { color: var(--member-title); }
.contributor.has-member-theme .text-link { color: var(--member-title); }
.contributor.has-member-theme .note { color: var(--member-title); }
@media(min-width:641px) { .grid > .contributor.has-member-theme:nth-child(odd)::after { width:calc(200% + 32px); } }

.member-bio { white-space: pre-line; margin-top: 16px; font-size: 15px; }
.member-work { margin-top: 20px; }
.member-work summary { cursor: pointer; padding-block: 8px; font-size: 15px; }
.member-work h4 { margin: 16px 0 8px; font-size: 16px; }
.contributor .member-work-image { display: block; width: 100%; height: auto; margin: 16px 0; border-radius: 4px; object-fit: contain; outline: none; }
.member-work p { color: var(--ink); }

.contributor.has-member-color .member-work-image { outline: none; }

/* Full-width row separators keep a restrained visual weight. */
#contributors-list > .contributor { border-bottom-color: var(--line); }
#contributors-list > .contributor::after { border-bottom-color: var(--line); }

.logo, .hero > h1 { color: var(--ink); }
